I want to use uinput to emulate pressing the menu key just next to the right Alt key. I tried KEY_MENU and KEY_CONTEXT_MENU, but neither of them worked. The key in Win32 API is VK_APPS.
Asked
Active
Viewed 214 times
2
-
Are you on some X11 environment (e.g. a Linux desktop)? If yes (very probably), use `xev` – Basile Starynkevitch Sep 28 '15 at 05:05
-
1`KEY_MENU` is correct. Are you sure you don't have something assigned to that in your keyboard options? – Ignacio Vazquez-Abrams Sep 28 '15 at 05:09
1 Answers
0
KEY_COMPOSE
is the correct Kernel keycode.
Some elaboration from Chromium’s keyboard event notes:
'Menu' and 'Props' naming differs between evdev and USB / UI Events. USB 0x010085 [System Main Menu] and USB 0x0C0040 [Menu Mode] both map to evdev 0x8B KEY_MENU (which has no corresponding UI Events |code|). USB 0x070076 [Keyboard Menu] does not map to KEY_MENU; it maps to evdev 0x82 KEY_PROPS, which is not the same as USB and UI Events "Props". USB 0x0700A3 [Props], which does correspond to UI Events "Props", is not mapped by the kernel. (And all of these are distinct from UI Events' "ContextMenu", which corresponds to USB 0x070065 [Keyboard Application] via evdev 0x7F KEY_COMPOSE, following Windows convention.)

Andrew Marshall
- 95,083
- 20
- 220
- 214