Sendstring keycode overhaul (#16941)

This commit is contained in:
Ryan 2022-04-29 09:36:48 +10:00 committed by GitHub
parent e2802ca2cb
commit 0de08b09e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,45 +21,53 @@
/* Punctuation */
#define X_ENT X_ENTER
#define X_ESC X_ESCAPE
#define X_BSPC X_BSPACE
#define X_BSPC X_BACKSPACE
#define X_SPC X_SPACE
#define X_MINS X_MINUS
#define X_EQL X_EQUAL
#define X_LBRC X_LBRACKET
#define X_RBRC X_RBRACKET
#define X_BSLS X_BSLASH
#define X_LBRC X_LEFT_BRACKET
#define X_RBRC X_RIGHT_BRACKET
#define X_BSLS X_BACKSLASH
#define X_NUHS X_NONUS_HASH
#define X_SCLN X_SCOLON
#define X_SCLN X_SEMICOLON
#define X_QUOT X_QUOTE
#define X_GRV X_GRAVE
#define X_COMM X_COMMA
#define X_SLSH X_SLASH
#define X_NUBS X_NONUS_BSLASH
#define X_NUBS X_NONUS_BACKSLASH
/* Lock Keys */
#define X_CLCK X_CAPSLOCK
#define X_CAPS X_CAPSLOCK
#define X_SLCK X_SCROLLLOCK
#define X_NLCK X_NUMLOCK
#define X_LCAP X_LOCKING_CAPS
#define X_LNUM X_LOCKING_NUM
#define X_LSCR X_LOCKING_SCROLL
#define X_CAPS X_CAPS_LOCK
#define X_SCRL X_SCROLL_LOCK
#define X_NUM X_NUM_LOCK
#define X_LCAP X_LOCKING_CAPS_LOCK
#define X_LNUM X_LOCKING_NUM_LOCK
#define X_LSCR X_LOCKING_SCROLL_LOCK
/* Commands */
#define X_PSCR X_PSCREEN
#define X_PSCR X_PRINT_SCREEN
#define X_PAUS X_PAUSE
#define X_BRK X_PAUSE
#define X_INS X_INSERT
#define X_PGUP X_PAGE_UP
#define X_DEL X_DELETE
#define X_PGDN X_PGDOWN
#define X_PGDN X_PAGE_DOWN
#define X_RGHT X_RIGHT
#define X_APP X_APPLICATION
#define X_EXEC X_EXECUTE
#define X_SLCT X_SELECT
#define X_AGIN X_AGAIN
#define X_PSTE X_PASTE
#define X_ERAS X_ALT_ERASE
#define X_ERAS X_ALTERNATE_ERASE
#define X_SYRQ X_SYSTEM_REQUEST
#define X_CNCL X_CANCEL
#define X_CLR X_CLEAR
#define X_PRIR X_PRIOR
#define X_RETN X_RETURN
#define X_SEPR X_SEPARATOR
#define X_CLAG X_CLEAR_AGAIN
#define X_CRSL X_CRSEL
#define X_EXSL X_EXSEL
/* Keypad */
#define X_PSLS X_KP_SLASH
@ -81,30 +89,42 @@
#define X_PEQL X_KP_EQUAL
#define X_PCMM X_KP_COMMA
/* Japanese specific */
#define X_ZKHK X_GRAVE
#define X_RO X_INT1
#define X_KANA X_INT2
#define X_JYEN X_INT3
#define X_HENK X_INT4
#define X_MHEN X_INT5
/* Korean specific */
#define X_HAEN X_LANG1
#define X_HANJ X_LANG2
/* Language Specific */
#define X_INT1 X_INTERNATIONAL_1
#define X_INT2 X_INTERNATIONAL_2
#define X_INT3 X_INTERNATIONAL_3
#define X_INT4 X_INTERNATIONAL_4
#define X_INT5 X_INTERNATIONAL_5
#define X_INT6 X_INTERNATIONAL_6
#define X_INT7 X_INTERNATIONAL_7
#define X_INT8 X_INTERNATIONAL_8
#define X_INT9 X_INTERNATIONAL_9
#define X_LNG1 X_LANGUAGE_1
#define X_LNG2 X_LANGUAGE_2
#define X_LNG3 X_LANGUAGE_3
#define X_LNG4 X_LANGUAGE_4
#define X_LNG5 X_LANGUAGE_5
#define X_LNG6 X_LANGUAGE_6
#define X_LNG7 X_LANGUAGE_7
#define X_LNG8 X_LANGUAGE_8
#define X_LNG9 X_LANGUAGE_9
/* Modifiers */
#define X_LCTL X_LCTRL
#define X_LSFT X_LSHIFT
#define X_LOPT X_LALT
#define X_LCMD X_LGUI
#define X_LWIN X_LGUI
#define X_RCTL X_RCTRL
#define X_RSFT X_RSHIFT
#define X_ALGR X_RALT
#define X_ROPT X_RALT
#define X_RCMD X_RGUI
#define X_RWIN X_RGUI
#define X_LCTL X_LEFT_CTRL
#define X_LSFT X_LEFT_SHIFT
#define X_LALT X_LEFT_ALT
#define X_LOPT X_LEFT_ALT
#define X_LGUI X_LEFT_GUI
#define X_LCMD X_LEFT_GUI
#define X_LWIN X_LEFT_GUI
#define X_RCTL X_RIGHT_CTRL
#define X_RSFT X_RIGHT_SHIFT
#define X_RALT X_RIGHT_ALT
#define X_ALGR X_RIGHT_ALT
#define X_ROPT X_RIGHT_ALT
#define X_RGUI X_RIGHT_GUI
#define X_RCMD X_RIGHT_GUI
#define X_RWIN X_RIGHT_GUI
/* Generic Desktop Page (0x01) */
#define X_PWR X_SYSTEM_POWER
@ -137,7 +157,7 @@
/* System Specific */
#define X_BRMU X_PAUSE
#define X_BRMD X_SCROLLLOCK
#define X_BRMD X_SCROLL_LOCK
/* Mouse Keys */
#define X_MS_U X_MS_UP
@ -149,6 +169,9 @@
#define X_BTN3 X_MS_BTN3
#define X_BTN4 X_MS_BTN4
#define X_BTN5 X_MS_BTN5
#define X_BTN6 X_MS_BTN6
#define X_BTN7 X_MS_BTN7
#define X_BTN8 X_MS_BTN8
#define X_WH_U X_MS_WH_UP
#define X_WH_D X_MS_WH_DOWN
#define X_WH_L X_MS_WH_LEFT
@ -196,22 +219,22 @@
#define X_0 27
#define X_ENTER 28
#define X_ESCAPE 29
#define X_BSPACE 2a
#define X_BACKSPACE 2a
#define X_TAB 2b
#define X_SPACE 2c
#define X_MINUS 2d
#define X_EQUAL 2e
#define X_LBRACKET 2f
#define X_RBRACKET 30
#define X_BSLASH 31
#define X_LEFT_BRACKET 2f
#define X_RIGHT_BRACKET 30
#define X_BACKSLASH 31
#define X_NONUS_HASH 32
#define X_SCOLON 33
#define X_SEMICOLON 33
#define X_QUOTE 34
#define X_GRAVE 35
#define X_COMMA 36
#define X_DOT 37
#define X_SLASH 38
#define X_CAPSLOCK 39
#define X_CAPS_LOCK 39
#define X_F1 3a
#define X_F2 3b
#define X_F3 3c
@ -224,20 +247,20 @@
#define X_F10 43
#define X_F11 44
#define X_F12 45
#define X_PSCREEN 46
#define X_SCROLLLOCK 47
#define X_PRINT_SCREEN 46
#define X_SCROLL_LOCK 47
#define X_PAUSE 48
#define X_INSERT 49
#define X_HOME 4a
#define X_PGUP 4b
#define X_PAGE_UP 4b
#define X_DELETE 4c
#define X_END 4d
#define X_PGDOWN 4e
#define X_PAGE_DOWN 4e
#define X_RIGHT 4f
#define X_LEFT 50
#define X_DOWN 51
#define X_UP 52
#define X_NUMLOCK 53
#define X_NUM_LOCK 53
#define X_KP_SLASH 54
#define X_KP_ASTERISK 55
#define X_KP_MINUS 56
@ -254,9 +277,9 @@
#define X_KP_9 61
#define X_KP_0 62
#define X_KP_DOT 63
#define X_NONUS_BSLASH 64
#define X_NONUS_BACKSLASH 64
#define X_APPLICATION 65
#define X_POWER 66
#define X_KB_POWER 66
#define X_KP_EQUAL 67
#define X_F13 68
#define X_F14 69
@ -281,34 +304,34 @@
#define X_COPY 7c
#define X_PASTE 7d
#define X_FIND 7e
#define X__MUTE 7f
#define X__VOLUP 80
#define X__VOLDOWN 81
#define X_LOCKING_CAPS 82
#define X_LOCKING_NUM 83
#define X_LOCKING_SCROLL 84
#define X_KB_MUTE 7f
#define X_KB_VOLUME_UP 80
#define X_KB_VOLUME_DOWN 81
#define X_LOCKING_CAPS_LOCK 82
#define X_LOCKING_NUM_LOCK 83
#define X_LOCKING_SCROLL_LOCK 84
#define X_KP_COMMA 85
#define X_KP_EQUAL_AS400 86
#define X_INT1 87
#define X_INT2 88
#define X_INT3 89
#define X_INT4 8a
#define X_INT5 8b
#define X_INT6 8c
#define X_INT7 8d
#define X_INT8 8e
#define X_INT9 8f
#define X_LANG1 90
#define X_LANG2 91
#define X_LANG3 92
#define X_LANG4 93
#define X_LANG5 94
#define X_LANG6 95
#define X_LANG7 96
#define X_LANG8 97
#define X_LANG9 98
#define X_ALT_ERASE 99
#define X_SYSREQ 9a
#define X_INTERNATIONAL_1 87
#define X_INTERNATIONAL_2 88
#define X_INTERNATIONAL_3 89
#define X_INTERNATIONAL_4 8a
#define X_INTERNATIONAL_5 8b
#define X_INTERNATIONAL_6 8c
#define X_INTERNATIONAL_7 8d
#define X_INTERNATIONAL_8 8e
#define X_INTERNATIONAL_9 8f
#define X_LANGUAGE_1 90
#define X_LANGUAGE_2 91
#define X_LANGUAGE_3 92
#define X_LANGUAGE_4 93
#define X_LANGUAGE_5 94
#define X_LANGUAGE_6 95
#define X_LANGUAGE_7 96
#define X_LANGUAGE_8 97
#define X_LANGUAGE_9 98
#define X_ALTERNATE_ERASE 99
#define X_SYSTEM_REQUEST 9a
#define X_CANCEL 9b
#define X_CLEAR 9c
#define X_PRIOR 9d
@ -321,14 +344,14 @@
#define X_EXSEL a4
/* Modifiers */
#define X_LCTRL e0
#define X_LSHIFT e1
#define X_LALT e2
#define X_LGUI e3
#define X_RCTRL e4
#define X_RSHIFT e5
#define X_RALT e6
#define X_RGUI e7
#define X_LEFT_CTRL e0
#define X_LEFT_SHIFT e1
#define X_LEFT_ALT e2
#define X_LEFT_GUI e3
#define X_RIGHT_CTRL e4
#define X_RIGHT_SHIFT e5
#define X_RIGHT_ALT e6
#define X_RIGHT_GUI e7
/* Media and Function keys */
/* Generic Desktop Page (0x01) */
@ -431,4 +454,52 @@
#define SS_RWIN(string) SS_RGUI(string)
// DEPRECATED
#define X_BSPACE X_BACKSPACE
#define X_LBRACKET X_LEFT_BRACKET
#define X_RBRACKET X_RIGHT_BRACKET
#define X_BSLASH X_BACKSLASH
#define X_SCOLON X_SEMICOLON
#define X_CAPSLOCK X_CAPS_LOCK
#define X_PSCREEN X_PRINT_SCREEN
#define X_SCROLLLOCK X_SCROLL_LOCK
#define X_PGDOWN X_PAGE_DOWN
#define X_NUMLOCK X_NUM_LOCK
#define X_NONUS_BSLASH X_NONUS_BACKSLASH
#define X_POWER X_KB_POWER
#define X__MUTE X_KB_MUTE
#define X__VOLUP X_KB_VOLUME_UP
#define X__VOLDOWN X_KB_VOLUME_DOWN
#define X_LOCKING_CAPS X_LOCKING_CAPS_LOCK
#define X_LOCKING_NUM X_LOCKING_NUM_LOCK
#define X_LOCKING_SCROLL X_LOCKING_SCROLL_LOCK
#define X_LANG1 X_LANGUAGE_1
#define X_LANG2 X_LANGUAGE_2
#define X_LANG3 X_LANGUAGE_3
#define X_LANG4 X_LANGUAGE_4
#define X_LANG5 X_LANGUAGE_5
#define X_LANG6 X_LANGUAGE_6
#define X_LANG7 X_LANGUAGE_7
#define X_LANG8 X_LANGUAGE_8
#define X_LANG9 X_LANGUAGE_9
#define X_ALT_ERASE X_ALTERNATE_ERASE
#define X_SYSREQ X_SYSTEM_REQUEST
#define X_LCTRL X_LEFT_CTRL
#define X_LSHIFT X_LEFT_SHIFT
#define X_RCTRL X_RIGHT_CTRL
#define X_RSHIFT X_RIGHT_SHIFT
#define X_ZKHK X_GRAVE
#define X_RO X_INTERNATIONAL_1
#define X_KANA X_INTERNATIONAL_2
#define X_JYEN X_INTERNATIONAL_3
#define X_HENK X_INTERNATIONAL_4
#define X_MHEN X_INTERNATIONAL_5
#define X_HAEN X_LANGUAGE_1
#define X_HANJ X_LANGUAGE_2
#define X_CLCK X_CAPS_LOCK
#define X_SLCK X_SCROLL_LOCK
#define X_NLCK X_NUM_LOCK
#define SS_LCTRL(string) SS_LCTL(string)