Skip to main content

Basic Keycodes

These keycodes are based on Universal Serial Bus HID Usage Tables Document Version 1.12 Chapter 10: Keyboard/Keypad Page(0x07) - Page 53

Usage ID (HEX)Usage NameKeycode Identifiers
00Reserved (No Event)KC_NO XXXXXXX
01Keyboard ErrorRollOverKC_ROLL_OVER KC_TRANSPARENT _______ KC_TRNS
02Keyboard PostFailKC_POST_FAIL
03Keyboard ErrorUndefinedKC_UNDEFINED
04Keyboard a and AKC_A
05Keyboard b and BKC_B
06Keyboard c and CKC_C
07Keyboard d and DKC_D
08Keyboard e and EKC_E
09Keyboard f and FKC_F
0AKeyboard g and GKC_G
0BKeyboard h and HKC_H
0CKeyboard i and IKC_I
0DKeyboard j and JKC_J
0EKeyboard k and KKC_K
0FKeyboard l and LKC_L
10Keyboard m and MKC_M
11Keyboard n and NKC_N
12Keyboard o and OKC_O
13Keyboard p and PKC_P
14Keyboard q and QKC_Q
15Keyboard r and RKC_R
16Keyboard s and SKC_S
17Keyboard t and TKC_T
18Keyboard u and UKC_U
19Keyboard v and VKC_V
1AKeyboard w and WKC_W
1BKeyboard x and XKC_X
1CKeyboard y and YKC_Y
1DKeyboard z and ZKC_Z
1EKeyboard 1 and !KC_1
1FKeyboard 2 and @KC_2
20Keyboard 3 and #KC_3
21Keyboard 4 and $KC_4
22Keyboard 5 and %KC_5
23Keyboard 6 and ^KC_6
24Keyboard 7 and &KC_7
25Keyboard 8 and *KC_8
26Keyboard 9 and (KC_9
27Keyboard 0 and )KC_0
28Keyboard ENTERKC_ENTER KC_ENT
29Keyboard ESCAPEKC_ESCAPE KC_ESC
2AKeyboard BACKSPACEKC_BSPACE KC_BSPC
2BKeyboard TABKC_TAB
2CKeyboard SPACEKC_SPACE KC_SPC
2DKeyboard - and _KC_MINUS KC_MINS
2EKeyboard = and +KC_EQUAL KC_EQL
2FKeyboard [ and {KC_LBRACKET KC_LBRC
30Keyboard ] and }KC_RBRACKET KC_RBRC
31Keyboard \ and |KC_BSLASH KC_BSLS
32Keyboard Non-US # and ~KC_NONUS_HASH KC_NUHS
33Keyboard ; and :KC_SCOLON KC_SCLN
34Keyboard ' and "KC_QUOTE KC_QUOT
35Keyboard ` and TildeKC_GRAVE KC_GRV
36Keyboard , and <KC_COMMA KC_COMM
37Keyboard . and >KC_DOT
38Keyboard / and ?KC_SLASH KC_SLSH
39Keyboard CAPS LOCKKC_CAPSLOCK KC_CAPS KC_CLCK
3AKeyboard F1KC_F1
3BKeyboard F2KC_F2
3CKeyboard F3KC_F3
3DKeyboard F4KC_F4
3EKeyboard F5KC_F5
3FKeyboard F6KC_F6
40Keyboard F7KC_F7
41Keyboard F8KC_F8
42Keyboard F9KC_F9
43Keyboard F10KC_F10
44Keyboard F11KC_F11
45Keyboard F12KC_F12
46Keyboard PrintScreenKC_PSCREEN
47Keyboard Scroll LockKC_SCROLLLOCK
48Keyboard PauseKC_PAUSE
49Keyboard InsertKC_INSERT
4AKeyboard HomeKC_HOME
4BKeyboard Page UpKC_PGUP
4CKeyboard DeleteKC_DELETE
4DKeyboard EndKC_END
4EKeyboard Page DownKC_PGDOWN
4FKeyboard Right ArrowKC_RIGHT
50Keyboard Left ArrowKC_LEFT
51Keyboard Down ArrowKC_DOWN
52Keyboard Up ArrowKC_UP
53Keyboard Num LockKC_NUMLOCK
54Keypad /KC_KP_SLASH
55Keypad *KC_KP_ASTERISK
56Keypad -KC_KP_MINUS
57Keypad +KC_KP_PLUS
58Keypad EnterKC_KP_ENTER
59Keypad 1 and EndKC_KP_1
5AKeypad 2 and Down ArrowKC_KP_2
5BKeypad 3 and Page DownKC_KP_3
5CKeypad 4 and Left ArrowKC_KP_4
5DKeypad 5KC_KP_5
5EKeypad 6 and Right ArrowKC_KP_6
5FKeypad 7 and HomeKC_KP_7
E0Keyboard Left ControlKC_LCTRL
E1Keyboard Left ShiftKC_LSHIFT
E2Keyboard Left AltKC_LALT
E3Keyboard Left GUIKC_LGUI
E4Keypad Right ControlKC_RCTRL
E5Keypad Right ShiftKC_RSHIFT
E6Keypad Right AltKC_RALT
E7Keypad Right GUIKC_RGUI

Table is still a work in progress. Refer to hid_keycodes.h and advanced_keycodes.h for a detailed list of keycodes.