enum: ashet.KeyUsageCode
Documentation
This is an enumeration of all well-known HID Keyboard/Keypad Page (0x07) usage codes for keys.
Note:
These codes do not necessarily correlate with what's printed on the key, but what's
printed on the same location of a typical US layout keyboard.
Use key usage codes for when you're interested in the *location* of a key, not the
its semantic meaning.
For example, the typical WASD input scheme would be ZQSD on an AZERTY keyboard, but
the locations would be the same.
Lore:
This mapping was chosen as it's the most widespread standard key list. These codes are directly produced by both USB and Bluetooth keyboards and don't require any translation in these cases. Also HID is a widespread standard.
Note:
The notes in this enumeration are taken verbatim from [HID Usage Tables, Version 1.6, Keyboard/Keypad Page (0x07)](https://usb.org/sites/default/files/hut1_6.pdf).
Items
a = 4Keyboard
aandANote:
Typically remapped for other languages in the host system.
b = 5Keyboard
bandBc = 6Keyboard
candCNote:
Typically remapped for other languages in the host system.
d = 7Keyboard
dandDe = 8Keyboard
eandEf = 9Keyboard
fandFg = 10Keyboard
gandGh = 11Keyboard
handHi = 12Keyboard
iandIj = 13Keyboard
jandJk = 14Keyboard
kandKl = 15Keyboard
landLm = 16Keyboard
mandMNote:
Typically remapped for other languages in the host system.
n = 17Keyboard
nandNo = 18Keyboard
oandONote:
Typically remapped for other languages in the host system.
p = 19Keyboard
pandPNote:
Typically remapped for other languages in the host system.
q = 20Keyboard
qandQNote:
Typically remapped for other languages in the host system.
r = 21Keyboard
randRs = 22Keyboard
sandSt = 23Keyboard
tandTu = 24Keyboard
uandUv = 25Keyboard
vandVw = 26Keyboard
wandWNote:
Typically remapped for other languages in the host system.
x = 27Keyboard
xandXNote:
Typically remapped for other languages in the host system.
y = 28Keyboard
yandYNote:
Typically remapped for other languages in the host system.
z = 29Keyboard
zandZNote:
Typically remapped for other languages in the host system.
1 = 30Keyboard
1and!Note:
Typically remapped for other languages in the host system.
2 = 31Keyboard
2and@Note:
Typically remapped for other languages in the host system.
3 = 32Keyboard
3and#Note:
Typically remapped for other languages in the host system.
4 = 33Keyboard
4and$Note:
Typically remapped for other languages in the host system.
5 = 34Keyboard
5and%Note:
Typically remapped for other languages in the host system.
6 = 35Keyboard
6and∧Note:
Typically remapped for other languages in the host system.
7 = 36Keyboard
7and&Note:
Typically remapped for other languages in the host system.
8 = 37Keyboard
8and*Note:
Typically remapped for other languages in the host system.
9 = 38Keyboard
9and(Note:
Typically remapped for other languages in the host system.
0 = 39Keyboard
0and)Note:
Typically remapped for other languages in the host system.
enter = 40Keyboard Return (ENTER)
escape = 41Keyboard ESCAPE
backspace = 42Keyboard DELETE (Backspace)
Note:
Backs up the cursor one position, deleting a character as it goes.
tab = 43Keyboard Tab
space = 44Keyboard Spacebar
minus = 45Keyboard
-and_equals = 46Keyboard
=and+Note:
Typically remapped for other languages in the host system.
square_bracket_open = 47Keyboard
[and{Note:
Typically remapped for other languages in the host system.
square_bracket_close = 48Keyboard
]and}Note:
Typically remapped for other languages in the host system.
backslash = 49Keyboard
\\and|Note:
Typically remapped for other languages in the host system.
non_us_hash = 50Keyboard Non-US
#and~Note:
Typical language mappings: US:
\|Belg:µ\£French Canadian:<}>Danish:'*Dutch:<>French:*µGerman:#'Italian:ù§LatinAmerica:}\]Norwegian:,*Spain:}ÇSwedish:,*Swiss:$,£UK:#~semicolon = 51Keyboard
;and:Note:
Typically remapped for other languages in the host system.
apostrophe = 52Keyboard
'and“Note:
Typically remapped for other languages in the host system.
grave_accent = 53Keyboard Grave Accent (
^) and Tilde (~)Note:
Typically remapped for other languages in the host system.
comma = 54Keyboard
,and<Note:
Typically remapped for other languages in the host system.
period = 55Keyboard
.and>Note:
Typically remapped for other languages in the host system.
slash = 56Keyboard
/and?Note:
Typically remapped for other languages in the host system.
caps_lock = 57Keyboard Caps Lock
Note:
Implemented as a non-locking key; sent as member of an array.
f1 = 58Keyboard F1
f2 = 59Keyboard F2
f3 = 60Keyboard F3
f4 = 61Keyboard F4
f5 = 62Keyboard F5
f6 = 63Keyboard F6
f7 = 64Keyboard F7
f8 = 65Keyboard F8
f9 = 66Keyboard F9
f10 = 67Keyboard F10
f11 = 68Keyboard F11
f12 = 69Keyboard F12
print_screen = 70Keyboard PrintScreen
Note:
Usage of keys is not modified by the state of the Control, Alt, Shift or Num Lock keys. That is, a key does not send extra codes to compensate for the state of any Control, Alt, Shift or Num Lock keys.
scroll_lock = 71Keyboard Scroll Lock
Note:
Implemented as a non-locking key; sent as member of an array.
pause = 72Keyboard Pause
Note:
Usage of keys is not modified by the state of the Control, Alt, Shift or Num Lock keys. That is, a key does not send extra codes to compensate for the state of any Control, Alt, Shift or Num Lock keys.
insert = 73Keyboard Insert
Note:
Usage of keys is not modified by the state of the Control, Alt, Shift or Num Lock keys. That is, a key does not send extra codes to compensate for the state of any Control, Alt, Shift or Num Lock keys.
home = 74Keyboard Home
Note:
Usage of keys is not modified by the state of the Control, Alt, Shift or Num Lock keys. That is, a key does not send extra codes to compensate for the state of any Control, Alt, Shift or Num Lock keys.
page_up = 75Keyboard PageUp
Note:
Usage of keys is not modified by the state of the Control, Alt, Shift or Num Lock keys. That is, a key does not send extra codes to compensate for the state of any Control, Alt, Shift or Num Lock keys.
delete = 76Keyboard Delete Forward
Note:
Usage of keys is not modified by the state of the Control, Alt, Shift or Num Lock keys. That is, a key does not send extra codes to compensate for the state of any Control, Alt, Shift or Num Lock keys.
Note:
Deletes one character without changing position.
end = 77Keyboard End
Note:
Usage of keys is not modified by the state of the Control, Alt, Shift or Num Lock keys. That is, a key does not send extra codes to compensate for the state of any Control, Alt, Shift or Num Lock keys.
page_down = 78Keyboard PageDown
Note:
Usage of keys is not modified by the state of the Control, Alt, Shift or Num Lock keys. That is, a key does not send extra codes to compensate for the state of any Control, Alt, Shift or Num Lock keys.
right_arrow = 79Keyboard RightArrow
Note:
Usage of keys is not modified by the state of the Control, Alt, Shift or Num Lock keys. That is, a key does not send extra codes to compensate for the state of any Control, Alt, Shift or Num Lock keys.
left_arrow = 80Keyboard LeftArrow
Note:
Usage of keys is not modified by the state of the Control, Alt, Shift or Num Lock keys. That is, a key does not send extra codes to compensate for the state of any Control, Alt, Shift or Num Lock keys.
down_arrow = 81Keyboard DownArrow
Note:
Usage of keys is not modified by the state of the Control, Alt, Shift or Num Lock keys. That is, a key does not send extra codes to compensate for the state of any Control, Alt, Shift or Num Lock keys.
up_arrow = 82Keyboard UpArrow
Note:
Usage of keys is not modified by the state of the Control, Alt, Shift or Num Lock keys. That is, a key does not send extra codes to compensate for the state of any Control, Alt, Shift or Num Lock keys.
num_lock = 83Keypad Num Lock and Clear
Note:
Implemented as a non-locking key; sent as member of an array.
kp_divide = 84Keypad
/Note:
Usage of keys is not modified by the state of the Control, Alt, Shift or Num Lock keys. That is, a key does not send extra codes to compensate for the state of any Control, Alt, Shift or Num Lock keys.
kp_multiply = 85Keypad
*kp_subtract = 86Keypad
-kp_add = 87Keypad
+kp_enter = 88Keypad ENTER
kp_1 = 89Keypad
1and Endkp_2 = 90Keypad
2and Down Arrowkp_3 = 91Keypad
3and PageDnkp_4 = 92Keypad
4and Left Arrowkp_5 = 93Keypad
5kp_6 = 94Keypad
6and Right Arrowkp_7 = 95Keypad
7and Homekp_8 = 96Keypad
8and Up Arrowkp_9 = 97Keypad
9and PageUpkp_0 = 98Keypad
0and Insertkp_period = 99Keypad
.and Deletenon_us_backslash = 100Keyboard Non-US
\\and|Note:
Typical language mappings: Belg:
<\>French Canadian:<°>Danish:<\>Dutch:]|[French:<>German:<|>Italian:<>Latin America:<>Norwegian:<>Spain:<>Swedish:<|>Swiss:<>UK:\|Brazil:\|Note:
Typically near the Left-Shift key in AT-102 implementations.
application = 101Keyboard Application
Note:
Windows key for Windows 95, and Compose.
power = 102Keyboard Power
kp_equals = 103Keypad
=f13 = 104Keyboard F13
f14 = 105Keyboard F14
f15 = 106Keyboard F15
f16 = 107Keyboard F16
f17 = 108Keyboard F17
f18 = 109Keyboard F18
f19 = 110Keyboard F19
f20 = 111Keyboard F20
f21 = 112Keyboard F21
f22 = 113Keyboard F22
f23 = 114Keyboard F23
f24 = 115Keyboard F24
execute = 116Keyboard Execute
help = 117Keyboard Help
menu = 118Keyboard Menu
select = 119Keyboard Select
stop = 120Keyboard Stop
again = 121Keyboard Again
undo = 122Keyboard Undo
cut = 123Keyboard Cut
copy = 124Keyboard Copy
paste = 125Keyboard Paste
find = 126Keyboard Find
mute = 127Keyboard Mute
volume_up = 128Keyboard Volume Up
volume_down = 129Keyboard Volume Down
locking_caps_lock = 130Keyboard Locking Caps Lock
Note:
Implemented as a locking key; sent as a toggle button. Available for legacy support; however, most systems should use the non-locking version of this key
locking_num_lock = 131Keyboard Locking Num Lock
Note:
Implemented as a locking key; sent as a toggle button. Available for legacy support; however, most systems should use the non-locking version of this key
locking_scroll_lock = 132Keyboard Locking Scroll Lock
Note:
Implemented as a locking key; sent as a toggle button. Available for legacy support; however, most systems should use the non-locking version of this key
kp_comma = 133Keypad Comma
Note:
Keypad Comma is the appropriate usage for the Brazilian keypad period (
.) key. This represents the closest possible match, and system software should do the correct mapping based on the current locale setting.kp_equals_as400 = 134Keypad Equal Sign
Note:
Used on AS/400 keyboards.
international1 = 135Keyboard International1
Note:
Keyboard International1 should be identified via footnote as the appropriate usage for the Brazilian forward-slash (
/) and question-mark (?) key. This usage should also be renamed to either "Keyboard Non-US/and?" or to "Keyboard International1" now that it's become clear that it does not only apply to Kanji keyboards anymore.international2 = 136Keyboard International2
international3 = 137Keyboard International3
international4 = 138Keyboard International4
international5 = 139Keyboard International5
international6 = 140Keyboard International6
international7 = 141Keyboard International7
Note:
Toggle Double-Byte/Single-Byte mode
international8 = 142Keyboard International8
Note:
Undefined, available for other Front End Language Processors.
international9 = 143Keyboard International9
Note:
Undefined, available for other Front End Language Processors.
lang1 = 144Keyboard LANG1
Note:
Hangul/English toggle key. This usage is used as an input method editor control key on a Korean language keyboard.
lang2 = 145Keyboard LANG2
Note:
Hanja conversion key. This usage is used as an input method editor control key on a Korean language keyboard.
lang3 = 146Keyboard LANG3
Note:
Defines the Katakana key for Japanese USB word-processing keyboards.
lang4 = 147Keyboard LANG4
Note:
Defines the Hiragana key for Japanese USB word-processing keyboards.
lang5 = 148Keyboard LANG5
Note:
Defines the Zenkaku/Hankaku key for Japanese USB word-processing keyboards.
lang6 = 149Keyboard LANG6
Note:
Reserved for language-specific functions, such as Front End Processors and Input Method Editors.
lang7 = 150Keyboard LANG7
Note:
Reserved for language-specific functions, such as Front End Processors and Input Method Editors.
lang8 = 151Keyboard LANG8
Note:
Reserved for language-specific functions, such as Front End Processors and Input Method Editors.
lang9 = 152Keyboard LANG9
Note:
Reserved for language-specific functions, such as Front End Processors and Input Method Editors.
alternate_erase = 153Keyboard Alternate Erase
Note:
Example, Erase-Eaze™ key.
term_sysreq_attention = 154Keyboard SysReq/Attention
Note:
Usage of keys is not modified by the state of the Control, Alt, Shift or Num Lock keys. That is, a key does not send extra codes to compensate for the state of any Control, Alt, Shift or Num Lock keys.
term_cancel = 155Keyboard Cancel
term_clear = 156Keyboard Clear
term_prior = 157Keyboard Prior
term_return = 158Keyboard Return
term_separator = 159Keyboard Separator
term_out = 160Keyboard Out
term_oper = 161Keyboard Oper
term_clear_again = 162Keyboard Clear/Again
term_crsel_props = 163Keyboard CrSel/Props
term_exsel = 164Keyboard ExSel
kp_double_0 = 176Keypad
00kp_triple_0 = 177Keypad
000kp_thousands_sep = 178Thousands Separator
Note:
The symbol displayed will depend on the current locale settings of the operating system. For example, the US thousands separator would be a comma, and the decimal separator would be a period.
kp_decimal_sep = 179Decimal Separator
Note:
The symbol displayed will depend on the current locale settings of the operating system. For example, the US thousands separator would be a comma, and the decimal separator would be a period.
kp_currency_unit = 180Currency Unit
Note:
The symbol displayed will depend on the current locale settings of the operating system. For example the US currency unit would be $ and the sub-unit would be ¢.
kp_currency_subunit = 181Currency Sub-unit
Note:
The symbol displayed will depend on the current locale settings of the operating system. For example the US currency unit would be $ and the sub-unit would be ¢.
kp_round_bracket_open = 182Keypad
(kp_round_bracket_close = 183Keypad
)kp_curly_bracket_open = 184Keypad
{kp_curly_bracket_close = 185Keypad
}kp_tab = 186Keypad Tab
kp_backspace = 187Keypad Backspace
kp_a = 188Keypad
Akp_b = 189Keypad
Bkp_c = 190Keypad
Ckp_d = 191Keypad
Dkp_e = 192Keypad
Ekp_f = 193Keypad
Fkp_logic_xor = 194Keypad XOR
kp_logic_and = 195Keypad
∧kp_percent = 196Keypad %
kp_less_than = 197Keypad
<kp_greater_than = 198Keypad
>kp_ampersand = 199Keypad
&kp_double_ampersand = 200Keypad
&&kp_pipe = 201Keypad
|kp_double_pipe = 202Keypad
||kp_colon = 203Keypad
:kp_hash = 204Keypad
#kp_space = 205Keypad Space
kp_at = 206Keypad
@kp_exlamation = 207Keypad
!kp_memory_store = 208Keypad Memory Store
kp_memory_recall = 209Keypad Memory Recall
kp_memory_clear = 210Keypad Memory Clear
kp_memory_add = 211Keypad Memory Add
kp_memory_subtract = 212Keypad Memory Subtract
kp_memory_multiply = 213Keypad Memory Multiply
kp_memory_divide = 214Keypad Memory Divide
kp_plus_minus = 215Keypad
+/-kp_clear = 216Keypad Clear
kp_clear_entry = 217Keypad Clear Entry
kp_binary = 218Keypad Binary
kp_octal = 219Keypad Octal
kp_decimal = 220Keypad Decimal
kp_hexadecimal = 221Keypad Hexadecimal
left_control = 224Keyboard Left Control
left_shift = 225Keyboard Left Shift
left_alt = 226Keyboard Left Alt
left_gui = 227Keyboard Left GUI
Note:
Windows key for Windows 95, and Compose.
Note:
Windowing environment key, examples are Microsoft® LEFT WIN key, Macintosh® LEFT APPLE key, Sun® LEFT META key.
right_control = 228Keyboard Right Control
right_shift = 229Keyboard Right Shift
right_alt = 230Keyboard Right Alt
right_gui = 231Keyboard Right GUI
Note:
Windows key for Windows 95, and Compose.
Note:
Windowing environment key, examples are Microsoft® RIGHT WIN key, Macintosh® RIGHT APPLE key, Sun® RIGHT META key.
...This enumeration is non-exhaustive and may assume all values a u16 can represent.