You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

256 lines
13 KiB

  1. # Basic Keycodes
  2. The basic set of keycodes are based on the [HID Keyboard/Keypad Usage Page (0x07)](https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf) with the exception of `KC_NO`, `KC_TRNS` and keycodes in the `0xA5-DF` range. See below for more details.
  3. ## Letters and Numbers
  4. |Key |Description|
  5. |------|-----------|
  6. |`KC_A`|`a` and `A`|
  7. |`KC_B`|`b` and `B`|
  8. |`KC_C`|`c` and `C`|
  9. |`KC_D`|`d` and `D`|
  10. |`KC_E`|`e` and `E`|
  11. |`KC_F`|`f` and `F`|
  12. |`KC_G`|`g` and `G`|
  13. |`KC_H`|`h` and `H`|
  14. |`KC_I`|`i` and `I`|
  15. |`KC_J`|`j` and `J`|
  16. |`KC_K`|`k` and `K`|
  17. |`KC_L`|`l` and `L`|
  18. |`KC_M`|`m` and `M`|
  19. |`KC_N`|`n` and `N`|
  20. |`KC_O`|`o` and `O`|
  21. |`KC_P`|`p` and `P`|
  22. |`KC_Q`|`q` and `Q`|
  23. |`KC_R`|`r` and `R`|
  24. |`KC_S`|`s` and `S`|
  25. |`KC_T`|`t` and `T`|
  26. |`KC_U`|`u` and `U`|
  27. |`KC_V`|`v` and `V`|
  28. |`KC_W`|`w` and `W`|
  29. |`KC_X`|`x` and `X`|
  30. |`KC_Y`|`y` and `Y`|
  31. |`KC_Z`|`z` and `Z`|
  32. |`KC_1`|`1` and `!`|
  33. |`KC_2`|`2` and `@`|
  34. |`KC_3`|`3` and `#`|
  35. |`KC_4`|`4` and `$`|
  36. |`KC_5`|`5` and `%`|
  37. |`KC_6`|`6` and `^`|
  38. |`KC_7`|`7` and `&`|
  39. |`KC_8`|`8` and `*`|
  40. |`KC_9`|`9` and `(`|
  41. |`KC_0`|`0` and `)`|
  42. ## F Keys
  43. |Key |Description|
  44. |--------|-----------|
  45. |`KC_F1` |F1 |
  46. |`KC_F2` |F2 |
  47. |`KC_F3` |F3 |
  48. |`KC_F4` |F4 |
  49. |`KC_F5` |F5 |
  50. |`KC_F6` |F6 |
  51. |`KC_F7` |F7 |
  52. |`KC_F8` |F8 |
  53. |`KC_F9` |F9 |
  54. |`KC_F10`|F10 |
  55. |`KC_F11`|F11 |
  56. |`KC_F12`|F12 |
  57. |`KC_F13`|F13 |
  58. |`KC_F14`|F14 |
  59. |`KC_F15`|F15 |
  60. |`KC_F16`|F16 |
  61. |`KC_F17`|F17 |
  62. |`KC_F18`|F18 |
  63. |`KC_F19`|F19 |
  64. |`KC_F20`|F20 |
  65. |`KC_F21`|F21 |
  66. |`KC_F22`|F22 |
  67. |`KC_F23`|F23 |
  68. |`KC_F24`|F24 |
  69. ## Punctuation
  70. |Key |Aliases |Description |
  71. |-----------------|-------------------|-----------------------------------------------|
  72. |`KC_ENTER` |`KC_ENT` |Return (Enter) |
  73. |`KC_ESCAPE` |`KC_ESC` |Escape |
  74. |`KC_BSPACE` |`KC_BSPC` |Delete (Backspace) |
  75. |`KC_TAB` | |Tab |
  76. |`KC_SPACE` |`KC_SPC` |Spacebar |
  77. |`KC_MINUS` |`KC_MINS` |`-` and `_` |
  78. |`KC_EQUAL` |`KC_EQL` |`=` and `+` |
  79. |`KC_LBRACKET` |`KC_LBRC` |`[` and `{` |
  80. |`KC_RBRACKET` |`KC_RBRC` |`]` and `}` |
  81. |`KC_BSLASH` |`KC_BSLS` |`\` and <code>&#124;</code> |
  82. |`KC_NONUS_HASH` |`KC_NUHS` |Non-US `#` and `~` |
  83. |`KC_SCOLON` |`KC_SCLN` |`;` and `:` |
  84. |`KC_QUOTE` |`KC_QUOT` |`'` and `"` |
  85. |`KC_GRAVE` |`KC_GRV`, `KC_ZKHK`|<code>&#96;</code> and `~`, JIS Zenkaku/Hankaku|
  86. |`KC_COMMA` |`KC_COMM` |`,` and `<` |
  87. |`KC_DOT` | |`.` and `>` |
  88. |`KC_SLASH` |`KC_SLSH` |`/` and `?` |
  89. |`KC_NONUS_BSLASH`|`KC_NUBS` |Non-US `\` and <code>&#124;</code> |
  90. ## Lock Keys
  91. |Key |Aliases |Description |
  92. |-------------------|--------------------|------------------------------------|
  93. |`KC_CAPSLOCK` |`KC_CLCK`, `KC_CAPS`|Caps Lock |
  94. |`KC_SCROLLLOCK` |`KC_SLCK`, `KC_BRMD`|Scroll Lock, Brightness Down (macOS)|
  95. |`KC_NUMLOCK` |`KC_NLCK` |Keypad Num Lock and Clear |
  96. |`KC_LOCKING_CAPS` |`KC_LCAP` |Locking Caps Lock |
  97. |`KC_LOCKING_NUM` |`KC_LNUM` |Locking Num Lock |
  98. |`KC_LOCKING_SCROLL`|`KC_LSCR` |Locking Scroll Lock |
  99. ## Modifiers
  100. |Key |Aliases |Description |
  101. |-----------|--------------------|------------------------------------|
  102. |`KC_LCTRL` |`KC_LCTL` |Left Control |
  103. |`KC_LSHIFT`|`KC_LSFT` |Left Shift |
  104. |`KC_LALT` | |Left Alt |
  105. |`KC_LGUI` |`KC_LCMD`, `KC_LWIN`|Left GUI (Windows/Command/Meta key) |
  106. |`KC_RCTRL` |`KC_RCTL` |Right Control |
  107. |`KC_RSHIFT`|`KC_RSFT` |Right Shift |
  108. |`KC_RALT` |`KC_ALGR` |Right Alt (AltGr) |
  109. |`KC_RGUI` |`KC_RCMD`, `KC_RWIN`|Right GUI (Windows/Command/Meta key)|
  110. ## International
  111. |Key |Aliases |Description |
  112. |----------|---------|-------------------------------|
  113. |`KC_INT1` |`KC_RO` |JIS `\` and `_` |
  114. |`KC_INT2` |`KC_KANA`|JIS Katakana/Hiragana |
  115. |`KC_INT3` |`KC_JYEN`|JIS `¥` and <code>&#124;</code>|
  116. |`KC_INT4` |`KC_HENK`|JIS Henkan |
  117. |`KC_INT5` |`KC_MHEN`|JIS Muhenkan |
  118. |`KC_INT6` | |JIS Numpad `,` |
  119. |`KC_INT7` | |International 7 |
  120. |`KC_INT8` | |International 8 |
  121. |`KC_INT9` | |International 9 |
  122. |`KC_LANG1`|`KC_HAEN`|Hangul/English |
  123. |`KC_LANG2`|`KC_HANJ`|Hanja |
  124. |`KC_LANG3`| |JIS Katakana |
  125. |`KC_LANG4`| |JIS Hiragana |
  126. |`KC_LANG5`| |JIS Zenkaku/Hankaku |
  127. |`KC_LANG6`| |Language 6 |
  128. |`KC_LANG7`| |Language 7 |
  129. |`KC_LANG8`| |Language 8 |
  130. |`KC_LANG9`| |Language 9 |
  131. ## Commands
  132. |Key |Aliases |Description |
  133. |------------------|------------------------------|------------------------------|
  134. |`KC_PSCREEN` |`KC_PSCR` |Print Screen |
  135. |`KC_PAUSE` |`KC_PAUS`, `KC_BRK`, `KC_BRMU`|Pause, Brightness Up (macOS) |
  136. |`KC_INSERT` |`KC_INS` |Insert |
  137. |`KC_HOME` | |Home |
  138. |`KC_PGUP` | |Page Up |
  139. |`KC_DELETE` |`KC_DEL` |Forward Delete |
  140. |`KC_END` | |End |
  141. |`KC_PGDOWN` |`KC_PGDN` |Page Down |
  142. |`KC_RIGHT` |`KC_RGHT` |Right Arrow |
  143. |`KC_LEFT` | |Left Arrow |
  144. |`KC_DOWN` | |Down Arrow |
  145. |`KC_UP` | |Up Arrow |
  146. |`KC_APPLICATION` |`KC_APP` |Application (Windows Menu Key)|
  147. |`KC_POWER` | |System Power (macOS/Linux) |
  148. |`KC_EXECUTE` |`KC_EXEC` |Execute |
  149. |`KC_HELP` | |Help |
  150. |`KC_MENU` | |Menu |
  151. |`KC_SELECT` |`KC_SLCT` |Select |
  152. |`KC_STOP` | |Stop |
  153. |`KC_AGAIN` |`KC_AGIN` |Again |
  154. |`KC_UNDO` | |Undo |
  155. |`KC_CUT` | |Cut |
  156. |`KC_COPY` | |Copy |
  157. |`KC_PASTE` |`KC_PSTE` |Paste |
  158. |`KC_FIND` | |Find |
  159. |`KC__MUTE` | |Mute (macOS) |
  160. |`KC__VOLUP` | |Volume Up (macOS) |
  161. |`KC__VOLDOWN` | |Volume Down (macOS) |
  162. |`KC_ALT_ERASE` |`KC_ERAS` |Alternate Erase |
  163. |`KC_SYSREQ` | |SysReq/Attention |
  164. |`KC_CANCEL` | |Cancel |
  165. |`KC_CLEAR` |`KC_CLR` |Clear |
  166. |`KC_PRIOR` | |Prior |
  167. |`KC_RETURN` | |Return |
  168. |`KC_SEPARATOR` | |Separator |
  169. |`KC_OUT` | |Out |
  170. |`KC_OPER` | |Oper |
  171. |`KC_CLEAR_AGAIN` | |Clear/Again |
  172. |`KC_CRSEL` | |CrSel/Props |
  173. |`KC_EXSEL` | |ExSel |
  174. ## Media Keys
  175. These keycodes are not part of the Keyboard/Keypad usage page. The `SYSTEM_` keycodes are found in the Generic Desktop page, and the rest are located in the Consumer page.
  176. Windows and macOS use different keycodes for "next track" and "previous track". Make sure you choose the keycode that corresponds to your OS.
  177. |Key |Aliases |Description |
  178. |-----------------------|---------|-----------------------------|
  179. |`KC_SYSTEM_POWER` |`KC_PWR` |System Power Down |
  180. |`KC_SYSTEM_SLEEP` |`KC_SLEP`|System Sleep |
  181. |`KC_SYSTEM_WAKE` |`KC_WAKE`|System Wake |
  182. |`KC_AUDIO_MUTE` |`KC_MUTE`|Mute |
  183. |`KC_AUDIO_VOL_UP` |`KC_VOLU`|Volume Up |
  184. |`KC_AUDIO_VOL_DOWN` |`KC_VOLD`|Volume Down |
  185. |`KC_MEDIA_NEXT_TRACK` |`KC_MNXT`|Next Track (Windows) |
  186. |`KC_MEDIA_PREV_TRACK` |`KC_MPRV`|Previous Track (Windows) |
  187. |`KC_MEDIA_STOP` |`KC_MSTP`|Stop Track (Windows) |
  188. |`KC_MEDIA_PLAY_PAUSE` |`KC_MPLY`|Play/Pause Track |
  189. |`KC_MEDIA_SELECT` |`KC_MSEL`|Launch Media Player (Windows)|
  190. |`KC_MEDIA_EJECT` |`KC_EJCT`|Eject (macOS) |
  191. |`KC_MAIL` | |Launch Mail (Windows) |
  192. |`KC_CALCULATOR` |`KC_CALC`|Launch Calculator (Windows) |
  193. |`KC_MY_COMPUTER` |`KC_MYCM`|Launch My Computer (Windows) |
  194. |`KC_WWW_SEARCH` |`KC_WSCH`|Browser Search (Windows) |
  195. |`KC_WWW_HOME` |`KC_WHOM`|Browser Home (Windows) |
  196. |`KC_WWW_BACK` |`KC_WBAK`|Browser Back (Windows) |
  197. |`KC_WWW_FORWARD` |`KC_WFWD`|Browser Forward (Windows) |
  198. |`KC_WWW_STOP` |`KC_WSTP`|Browser Stop (Windows) |
  199. |`KC_WWW_REFRESH` |`KC_WREF`|Browser Refresh (Windows) |
  200. |`KC_WWW_FAVORITES` |`KC_WFAV`|Browser Favorites (Windows) |
  201. |`KC_MEDIA_FAST_FORWARD`|`KC_MFFD`|Next Track (macOS) |
  202. |`KC_MEDIA_REWIND` |`KC_MRWD`|Previous Track (macOS) |
  203. |`KC_BRIGHTNESS_UP` |`KC_BRIU`|Brightness Up |
  204. |`KC_BRIGHTNESS_DOWN` |`KC_BRID`|Brightness Down |
  205. ## Number Pad
  206. |Key |Aliases |Description |
  207. |-------------------|---------|------------------------------|
  208. |`KC_KP_SLASH` |`KC_PSLS`|Keypad `/` |
  209. |`KC_KP_ASTERISK` |`KC_PAST`|Keypad `*` |
  210. |`KC_KP_MINUS` |`KC_PMNS`|Keypad `-` |
  211. |`KC_KP_PLUS` |`KC_PPLS`|Keypad `+` |
  212. |`KC_KP_ENTER` |`KC_PENT`|Keypad Enter |
  213. |`KC_KP_1` |`KC_P1` |Keypad `1` and End |
  214. |`KC_KP_2` |`KC_P2` |Keypad `2` and Down Arrow |
  215. |`KC_KP_3` |`KC_P3` |Keypad `3` and Page Down |
  216. |`KC_KP_4` |`KC_P4` |Keypad `4` and Left Arrow |
  217. |`KC_KP_5` |`KC_P5` |Keypad `5` |
  218. |`KC_KP_6` |`KC_P6` |Keypad `6` and Right Arrow |
  219. |`KC_KP_7` |`KC_P7` |Keypad `7` and Home |
  220. |`KC_KP_8` |`KC_P8` |Keypad `8` and Up Arrow |
  221. |`KC_KP_9` |`KC_P9` |Keypad `9` and Page Up |
  222. |`KC_KP_0` |`KC_P0` |Keypad `0` and Insert |
  223. |`KC_KP_DOT` |`KC_PDOT`|Keypad `.` and Delete |
  224. |`KC_KP_EQUAL` |`KC_PEQL`|Keypad `=` |
  225. |`KC_KP_COMMA` |`KC_PCMM`|Keypad `,` |
  226. |`KC_KP_EQUAL_AS400`| |Keypad `=` on AS/400 keyboards|
  227. ## Special Keys
  228. In addition to these, keycodes in the range of `0xA5-DF` are reserved for internal use by TMK.
  229. |Key |Aliases |Description |
  230. |----------------|--------------------|---------------------------------------|
  231. |`KC_NO` |`XXXXXXX` |Ignore this key (NOOP) |
  232. |`KC_TRANSPARENT`|`KC_TRNS`, `_______`|Use the next lowest non-transparent key|