Ashet OS

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 = 4

Keyboard a and A

Note:

Typically remapped for other languages in the host system.

b = 5

Keyboard b and B

c = 6

Keyboard c and C

Note:

Typically remapped for other languages in the host system.

d = 7

Keyboard d and D

e = 8

Keyboard e and E

f = 9

Keyboard f and F

g = 10

Keyboard g and G

h = 11

Keyboard h and H

i = 12

Keyboard i and I

j = 13

Keyboard j and J

k = 14

Keyboard k and K

l = 15

Keyboard l and L

m = 16

Keyboard m and M

Note:

Typically remapped for other languages in the host system.

n = 17

Keyboard n and N

o = 18

Keyboard o and O

Note:

Typically remapped for other languages in the host system.

p = 19

Keyboard p and P

Note:

Typically remapped for other languages in the host system.

q = 20

Keyboard q and Q

Note:

Typically remapped for other languages in the host system.

r = 21

Keyboard r and R

s = 22

Keyboard s and S

t = 23

Keyboard t and T

u = 24

Keyboard u and U

v = 25

Keyboard v and V

w = 26

Keyboard w and W

Note:

Typically remapped for other languages in the host system.

x = 27

Keyboard x and X

Note:

Typically remapped for other languages in the host system.

y = 28

Keyboard y and Y

Note:

Typically remapped for other languages in the host system.

z = 29

Keyboard z and Z

Note:

Typically remapped for other languages in the host system.

1 = 30

Keyboard 1 and !

Note:

Typically remapped for other languages in the host system.

2 = 31

Keyboard 2 and @

Note:

Typically remapped for other languages in the host system.

3 = 32

Keyboard 3 and #

Note:

Typically remapped for other languages in the host system.

4 = 33

Keyboard 4 and $

Note:

Typically remapped for other languages in the host system.

5 = 34

Keyboard 5 and %

Note:

Typically remapped for other languages in the host system.

6 = 35

Keyboard 6 and

Note:

Typically remapped for other languages in the host system.

7 = 36

Keyboard 7 and &

Note:

Typically remapped for other languages in the host system.

8 = 37

Keyboard 8 and *

Note:

Typically remapped for other languages in the host system.

9 = 38

Keyboard 9 and (

Note:

Typically remapped for other languages in the host system.

0 = 39

Keyboard 0 and )

Note:

Typically remapped for other languages in the host system.

enter = 40

Keyboard Return (ENTER)

escape = 41

Keyboard ESCAPE

backspace = 42

Keyboard DELETE (Backspace)

Note:

Backs up the cursor one position, deleting a character as it goes.

tab = 43

Keyboard Tab

space = 44

Keyboard Spacebar

minus = 45

Keyboard - and _

equals = 46

Keyboard = and +

Note:

Typically remapped for other languages in the host system.

square_bracket_open = 47

Keyboard [ and {

Note:

Typically remapped for other languages in the host system.

square_bracket_close = 48

Keyboard ] and }

Note:

Typically remapped for other languages in the host system.

backslash = 49

Keyboard \\ and |

Note:

Typically remapped for other languages in the host system.

non_us_hash = 50

Keyboard Non-US # and ~

Note:

Typical language mappings: US: \ | Belg: µ \ £ French Canadian: < } > Danish: ' * Dutch: < > French: * µ German: # ' Italian: ù § LatinAmerica: } \ ] Norwegian: , * Spain: } Ç Swedish: , * Swiss: $, £ UK: # ~

semicolon = 51

Keyboard ; and :

Note:

Typically remapped for other languages in the host system.

apostrophe = 52

Keyboard ' and

Note:

Typically remapped for other languages in the host system.

grave_accent = 53

Keyboard Grave Accent (^) and Tilde (~)

Note:

Typically remapped for other languages in the host system.

comma = 54

Keyboard , and <

Note:

Typically remapped for other languages in the host system.

period = 55

Keyboard . and >

Note:

Typically remapped for other languages in the host system.

slash = 56

Keyboard / and ?

Note:

Typically remapped for other languages in the host system.

caps_lock = 57

Keyboard Caps Lock

Note:

Implemented as a non-locking key; sent as member of an array.

f1 = 58

Keyboard F1

f2 = 59

Keyboard F2

f3 = 60

Keyboard F3

f4 = 61

Keyboard F4

f5 = 62

Keyboard F5

f6 = 63

Keyboard F6

f7 = 64

Keyboard F7

f8 = 65

Keyboard F8

f9 = 66

Keyboard F9

f10 = 67

Keyboard F10

f11 = 68

Keyboard F11

f12 = 69

Keyboard F12

print_screen = 70

Keyboard 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 = 71

Keyboard Scroll Lock

Note:

Implemented as a non-locking key; sent as member of an array.

pause = 72

Keyboard 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 = 73

Keyboard 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 = 74

Keyboard 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 = 75

Keyboard 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 = 76

Keyboard 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 = 77

Keyboard 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 = 78

Keyboard 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 = 79

Keyboard 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 = 80

Keyboard 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 = 81

Keyboard 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 = 82

Keyboard 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 = 83

Keypad Num Lock and Clear

Note:

Implemented as a non-locking key; sent as member of an array.

kp_divide = 84

Keypad /

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 = 85

Keypad *

kp_subtract = 86

Keypad -

kp_add = 87

Keypad +

kp_enter = 88

Keypad ENTER

kp_1 = 89

Keypad 1 and End

kp_2 = 90

Keypad 2 and Down Arrow

kp_3 = 91

Keypad 3 and PageDn

kp_4 = 92

Keypad 4 and Left Arrow

kp_5 = 93

Keypad 5

kp_6 = 94

Keypad 6 and Right Arrow

kp_7 = 95

Keypad 7 and Home

kp_8 = 96

Keypad 8 and Up Arrow

kp_9 = 97

Keypad 9 and PageUp

kp_0 = 98

Keypad 0 and Insert

kp_period = 99

Keypad . and Delete

non_us_backslash = 100

Keyboard 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 = 101

Keyboard Application

Note:

Windows key for Windows 95, and Compose.

power = 102

Keyboard Power

kp_equals = 103

Keypad =

f13 = 104

Keyboard F13

f14 = 105

Keyboard F14

f15 = 106

Keyboard F15

f16 = 107

Keyboard F16

f17 = 108

Keyboard F17

f18 = 109

Keyboard F18

f19 = 110

Keyboard F19

f20 = 111

Keyboard F20

f21 = 112

Keyboard F21

f22 = 113

Keyboard F22

f23 = 114

Keyboard F23

f24 = 115

Keyboard F24

execute = 116

Keyboard Execute

help = 117

Keyboard Help

menu = 118

Keyboard Menu

select = 119

Keyboard Select

stop = 120

Keyboard Stop

again = 121

Keyboard Again

undo = 122

Keyboard Undo

cut = 123

Keyboard Cut

copy = 124

Keyboard Copy

paste = 125

Keyboard Paste

find = 126

Keyboard Find

mute = 127

Keyboard Mute

volume_up = 128

Keyboard Volume Up

volume_down = 129

Keyboard Volume Down

locking_caps_lock = 130

Keyboard 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 = 131

Keyboard 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 = 132

Keyboard 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 = 133

Keypad 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 = 134

Keypad Equal Sign

Note:

Used on AS/400 keyboards.

international1 = 135

Keyboard 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 = 136

Keyboard International2

international3 = 137

Keyboard International3

international4 = 138

Keyboard International4

international5 = 139

Keyboard International5

international6 = 140

Keyboard International6

international7 = 141

Keyboard International7

Note:

Toggle Double-Byte/Single-Byte mode

international8 = 142

Keyboard International8

Note:

Undefined, available for other Front End Language Processors.

international9 = 143

Keyboard International9

Note:

Undefined, available for other Front End Language Processors.

lang1 = 144

Keyboard LANG1

Note:

Hangul/English toggle key. This usage is used as an input method editor control key on a Korean language keyboard.

lang2 = 145

Keyboard LANG2

Note:

Hanja conversion key. This usage is used as an input method editor control key on a Korean language keyboard.

lang3 = 146

Keyboard LANG3

Note:

Defines the Katakana key for Japanese USB word-processing keyboards.

lang4 = 147

Keyboard LANG4

Note:

Defines the Hiragana key for Japanese USB word-processing keyboards.

lang5 = 148

Keyboard LANG5

Note:

Defines the Zenkaku/Hankaku key for Japanese USB word-processing keyboards.

lang6 = 149

Keyboard LANG6

Note:

Reserved for language-specific functions, such as Front End Processors and Input Method Editors.

lang7 = 150

Keyboard LANG7

Note:

Reserved for language-specific functions, such as Front End Processors and Input Method Editors.

lang8 = 151

Keyboard LANG8

Note:

Reserved for language-specific functions, such as Front End Processors and Input Method Editors.

lang9 = 152

Keyboard LANG9

Note:

Reserved for language-specific functions, such as Front End Processors and Input Method Editors.

alternate_erase = 153

Keyboard Alternate Erase

Note:

Example, Erase-Eaze™ key.

term_sysreq_attention = 154

Keyboard 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 = 155

Keyboard Cancel

term_clear = 156

Keyboard Clear

term_prior = 157

Keyboard Prior

term_return = 158

Keyboard Return

term_separator = 159

Keyboard Separator

term_out = 160

Keyboard Out

term_oper = 161

Keyboard Oper

term_clear_again = 162

Keyboard Clear/Again

term_crsel_props = 163

Keyboard CrSel/Props

term_exsel = 164

Keyboard ExSel

kp_double_0 = 176

Keypad 00

kp_triple_0 = 177

Keypad 000

kp_thousands_sep = 178

Thousands 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 = 179

Decimal 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 = 180

Currency 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 = 181

Currency 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 = 182

Keypad (

kp_round_bracket_close = 183

Keypad )

kp_curly_bracket_open = 184

Keypad {

kp_curly_bracket_close = 185

Keypad }

kp_tab = 186

Keypad Tab

kp_backspace = 187

Keypad Backspace

kp_a = 188

Keypad A

kp_b = 189

Keypad B

kp_c = 190

Keypad C

kp_d = 191

Keypad D

kp_e = 192

Keypad E

kp_f = 193

Keypad F

kp_logic_xor = 194

Keypad XOR

kp_logic_and = 195

Keypad

kp_percent = 196

Keypad %

kp_less_than = 197

Keypad <

kp_greater_than = 198

Keypad >

kp_ampersand = 199

Keypad &

kp_double_ampersand = 200

Keypad &&

kp_pipe = 201

Keypad |

kp_double_pipe = 202

Keypad ||

kp_colon = 203

Keypad :

kp_hash = 204

Keypad #

kp_space = 205

Keypad Space

kp_at = 206

Keypad @

kp_exlamation = 207

Keypad !

kp_memory_store = 208

Keypad Memory Store

kp_memory_recall = 209

Keypad Memory Recall

kp_memory_clear = 210

Keypad Memory Clear

kp_memory_add = 211

Keypad Memory Add

kp_memory_subtract = 212

Keypad Memory Subtract

kp_memory_multiply = 213

Keypad Memory Multiply

kp_memory_divide = 214

Keypad Memory Divide

kp_plus_minus = 215

Keypad +/-

kp_clear = 216

Keypad Clear

kp_clear_entry = 217

Keypad Clear Entry

kp_binary = 218

Keypad Binary

kp_octal = 219

Keypad Octal

kp_decimal = 220

Keypad Decimal

kp_hexadecimal = 221

Keypad Hexadecimal

left_control = 224

Keyboard Left Control

left_shift = 225

Keyboard Left Shift

left_alt = 226

Keyboard Left Alt

left_gui = 227

Keyboard 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 = 228

Keyboard Right Control

right_shift = 229

Keyboard Right Shift

right_alt = 230

Keyboard Right Alt

right_gui = 231

Keyboard 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.