Skip to main content

Key events (Internal use only)

xtd keys

Windows Physical KeyLinux Physical KeymacOS Physical KeyWindows Virtual KeyLinux Virtual KeymacOS Virtual Keyxtd Key (xtd::forms::keys)Virtual Modifier Keyxtd Modifier Key (xtd::forms::keys)
Shift LeftShift LeftShift LeftVK_SHIFT (0x00000010)GDK_KEY_Shift_L (0x0000FFE1)kVK_Shift (0x00000038)shift_key (0x00000010)VK_SHIFT_MODIFIER (0x00010000)shift (0x00010000)
Control LeftControl LeftCommand LeftVK_CONTROL (0x00000011)GDK_KEY_Control_L (0x0000FFE3)kVK_Command (0x00000037)control_key/command_key (0x00000011)VK_CONTROL_MODIFIER (0x00020000)control/command (0x00020000)
Alt LeftAlt LeftOption LeftVK_MENU (0x00000012)GDK_KEY_Alt_L (0x0000FFE9)kVK_Option (0x0000003A)menu/option_key (0x00000012)VK_ALT_MODIFIER (0x00040000)alt/option (0x00040000)
Windows LeftWindows LeftControl LeftVK_LWIN (0x0000005B)GDK_KEY_Super_L (0x0000FFEB)kVK_Control (0x0000003B)lwin (0x0000005B)VK_META_MODIFIER (0x00100000)meta (0x00100000)
Shift RightShift RightShift RightVK_SHIFT (0x00000010)GDK_KEY_Shift_R (0x0000FFE2)kVK_RightShift (0x0000003C)shift_key (0x00000010)VK_SHIFT_MODIFIER (0x00010000)shift (0x00010000)
Control RightControl RightCommand RightVK_CONTROL (0x00000011)GDK_KEY_Control_R (0x0000FFE4)kVK_RightCommand (0x00000036)control_key/command_key (0x00000011)VK_CONTROL_MODIFIER (0x00020000)control/command (0x00020000)
Alt RightAlt RightOption RightVK_CONTROL + VK_MENUGDK_KEY_Alt_R (0x0000FFEA)kVK_RightOption (0x0000003D)control_key/command_key + menu/option_keyVK_CONTROL_MODIFIER + VK_ALT_MODIFIERcontrol/command + alt/option
Windows RightWindows RightControl RightVK_RWIN (0x0000005C)GDK_KEY_Super_R (0x0000FFEC)kVK_RightControl (0x0000003E)rwin (0x0000005C)VK_META_MODIFIER (0x00100000)meta (0x00100000)

Remarks

  • Windows Virual key codes : Winuser.h
  • Linux Virual key codes : gdkkeysyms.h
  • macOS Virual key codes : Events.h
  • Alt Right on Linux seems to be : 0x0000FE03

To do

  • Remove VK_COMMAND_MODIFIER key.
  • Set xtd::forms::keys::command = xtd::forms::keys::control.
  • When convert key to virtual keys, on macOS platform swap meta and control keys :
    • Windows Left => VK_CONTROL
    • Windows Right => VK_CONTROL
    • Control Left => VK_LWIN
    • Control Right => VK_RWIN
  • Fix workarounds on macOS and Linux platforms in control_handler key down and key up events.

wxWidgets keys

Windows Physical KeyLinux Physical KeymacOS Physical KeyWindows Raw KeyLinux Raw KeymacOS Raw KeywxWidgets - Windows Key presswxWidgets - macOS Key presswxWidgets - Linux Key presswxWidgets - Windows ModifierwxWidgets - macOS ModifierwxWidgets - Linux Modifier
Shift LeftShift LeftShift Left0x000000100x0000FFE10x00000038WXK_SHIFTWXK_SHIFTWXK_SHIFTShiftShiftShift
Control LeftControl LeftControl Left0x000000110x0000FFE30x0000003BWXK_COMMANDWXK_RAW_CONTROLWXK_COMMANDControlControlControl
Alt LeftAlt LeftOption Left0x000000120x0000FFE90x0000003AWXK_ALTWXK_ALTWXK_ALTAltAltAlt
Windows LeftWindows LeftCommand Left0x0000005B0x0000FFEB0x00000037WXK_WINDOWS_LEFTWXK_COMMANDWXK_COMMANDNoneCommandCommand
Shift RightShift RightShift Right0x000000100x0000FFE20x0000003CWXK_SHIFTWXK_SHIFTWXK_SHIFTShiftShiftShift
Control RightControl RightControl Right0x000000110x0000FFE40x0000003EWXK_COMMANDWXK_RAW_CONTROLWXK_COMMANDControlControlControl
Alt RightAlt RightOption Right0x00000011, 0x000000120x0000FFEA0x0000003DWXK_COMMAND, WXK_ALTWXK_ALTWXK_NONEControl, AltAltNone (OnUp : Control, Alt)
Windows RightWindows RightCommand Right0x0000005C0x0000FFEC0x00000036WXK_WINDOWS_RIGHTWXK_COMMANDWXK_ALTNoneCommandMeta

Remarks

  • Option / Alt right on Windows send VK_CONTROL left followed by VK_MENU left keys and Control + Alt modifiers (AltGr modifier ?)...