Keyboard firmwares for Atmel AVR and Cortex-M
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.

usb_keycodes.h 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. /*
  2. * Key codes from HID Keyboard/Keypad Page
  3. * http://www.usb.org/developers/devclass_docs/Hut1_12.pdf
  4. *
  5. * Based on Keyboard Upgrade v0.3.0 http://github.com/rhomann/kbupgrade
  6. */
  7. /*
  8. * Keyboard Upgrade -- Firmware for homebrew computer keyboard controllers.
  9. * Copyright (C) 2009 Robert Homann
  10. *
  11. * Based on RUMP (http://mg8.org/rump/), Copyright (C) 2008 Chris Lee
  12. *
  13. * Based on c64key (http://symlink.dk/projects/c64key/),
  14. * Copyright (C) 2006-2007 Mikkel Holm Olsen
  15. *
  16. * Based on HID-Test by Christian Starkjohann, Objective Development
  17. *
  18. * This file is part of the Keyboard Upgrade package.
  19. *
  20. * This program is free software; you can redistribute it and/or modify
  21. * it under the terms of the GNU General Public License as published by
  22. * the Free Software Foundation; either version 2 of the License, or
  23. * (at your option) any later version.
  24. *
  25. * This program is distributed in the hope that it will be useful, but
  26. * WITHOUT ANY WARRANTY; without even the implied warranty of
  27. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  28. * GNU General Public License for more details.
  29. *
  30. * You should have received a copy of the GNU General Public License
  31. * along with the Keyboard Upgrade package; if not, write to the
  32. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  33. * MA 02110-1301 USA
  34. */
  35. #ifndef USB_KEYCODES_H
  36. #define USB_KEYCODES_H
  37. enum keycodes {
  38. KB_NO = 0,
  39. KB_ROLL_OVER,
  40. KB_POST_FAIL,
  41. KB_UNDEFINED,
  42. KB_A,
  43. KB_B,
  44. KB_C,
  45. KB_D,
  46. KB_E,
  47. KB_F,
  48. KB_G,
  49. KB_H,
  50. KB_I,
  51. KB_J,
  52. KB_K,
  53. KB_L,
  54. KB_M, /* 0x10 */
  55. KB_N,
  56. KB_O,
  57. KB_P,
  58. KB_Q,
  59. KB_R,
  60. KB_S,
  61. KB_T,
  62. KB_U,
  63. KB_V,
  64. KB_W,
  65. KB_X,
  66. KB_Y,
  67. KB_Z,
  68. KB_1,
  69. KB_2,
  70. KB_3, /* 0x20 */
  71. KB_4,
  72. KB_5,
  73. KB_6,
  74. KB_7,
  75. KB_8,
  76. KB_9,
  77. KB_0,
  78. KB_ENTER,
  79. KB_ESCAPE,
  80. KB_BSPACE,
  81. KB_TAB,
  82. KB_SPACE,
  83. KB_MINUS,
  84. KB_EQUAL,
  85. KB_LBRACKET, /* [ */
  86. KB_RBRACKET, /* ] */
  87. KB_BSLASH, /* \ (and |) */
  88. KB_NONUS_HASH, /* Non-US # and ~ */
  89. KB_SCOLON, /* ; (and :) */
  90. KB_QUOTE, /* ' and " */
  91. KB_GRAVE, /* Grave accent and tilde */
  92. KB_COMMA, /* , and < */
  93. KB_DOT, /* . and > */
  94. KB_SLASH, /* / and ? */
  95. KB_CAPSLOCK,
  96. KB_F1,
  97. KB_F2,
  98. KB_F3,
  99. KB_F4,
  100. KB_F5,
  101. KB_F6,
  102. KB_F7, /* 0x40 */
  103. KB_F8,
  104. KB_F9,
  105. KB_F10,
  106. KB_F11,
  107. KB_F12,
  108. KB_PSCREEN,
  109. KB_SCKLOCK,
  110. KB_BREAK,
  111. KB_INSERT,
  112. KB_HOME,
  113. KB_PGUP,
  114. KB_DELETE,
  115. KB_END,
  116. KB_PGDOWN,
  117. KB_RIGHT,
  118. KB_LEFT, /* 0x50 */
  119. KB_DOWN,
  120. KB_UP,
  121. KB_NUMLOCK,
  122. KP_SLASH,
  123. KP_ASTERISK,
  124. KP_MINUS,
  125. KP_PLUS,
  126. KP_ENTER,
  127. KP_1,
  128. KP_2,
  129. KP_3,
  130. KP_4,
  131. KP_5,
  132. KP_6,
  133. KP_7,
  134. KP_8, /* 0x60 */
  135. KP_9,
  136. KP_0,
  137. KP_DOT,
  138. KB_NONUS_BSLASH, /* Non-US \ and | */
  139. KB_APPLICATION,
  140. KB_POWER,
  141. KP_EQUAL,
  142. KB_F13,
  143. KB_F14,
  144. KB_F15,
  145. KB_F16,
  146. KB_F17,
  147. KB_F18,
  148. KB_F19,
  149. KB_F20,
  150. KB_F21, /* 0x70 */
  151. KB_F22,
  152. KB_F23,
  153. KB_F24,
  154. KB_EXECUTE,
  155. KB_HELP,
  156. KB_MENU,
  157. KB_SELECT,
  158. KB_STOP,
  159. KB_AGAIN,
  160. KB_UNDO,
  161. KB_CUT,
  162. KB_COPY,
  163. KB_PASTE,
  164. KB_FIND,
  165. KB_MUTE,
  166. KB_VOLUP, /* 0x80 */
  167. KB_VOLDOWN,
  168. KB_LOCKING_CAPS, /* locking Caps Lock */
  169. KB_LOCKING_NUM, /* locking Num Lock */
  170. KB_LOCKING_SCROLL, /* locking Scroll Lock */
  171. KP_COMMA,
  172. KP_EQUAL_AS400, /* equal sign on AS/400 */
  173. KB_INT1,
  174. KB_INT2,
  175. KB_INT3,
  176. KB_INT4,
  177. KB_INT5,
  178. KB_INT6,
  179. KB_INT7,
  180. KB_INT8,
  181. KB_INT9,
  182. KB_LANG1, /* 0x90 */
  183. KB_LANG2,
  184. KB_LANG3,
  185. KB_LANG4,
  186. KB_LANG5,
  187. KB_LANG6,
  188. KB_LANG7,
  189. KB_LANG8,
  190. KB_LANG9,
  191. KB_ALT_ERASE,
  192. KB_SYSREQ,
  193. KB_CANCEL,
  194. KB_CLEAR,
  195. KB_PRIOR,
  196. KB_RETURN,
  197. KB_SEPARATOR,
  198. KB_OUT,
  199. KB_OPER,
  200. KB_CLEAR_AGAIN,
  201. KB_CRSEL,
  202. KB_EXSEL,
  203. KP_00 = 0xB0,
  204. KP_000,
  205. KB_THOUSANDS_SEPARATOR,
  206. KB_DECIMAL_SEPARATOR,
  207. CURRENCY_UNIT,
  208. CURRENCY_SUB_UNIT,
  209. KP_LPAREN,
  210. KP_RPAREN,
  211. KP_LCBRACKET, /* { */
  212. KP_RCBRACKET, /* } */
  213. KP_TAB,
  214. KP_BSPACE,
  215. KP_A,
  216. KP_B,
  217. KP_C,
  218. KP_D,
  219. KP_E,
  220. KP_F,
  221. KP_XOR,
  222. KP_HAT,
  223. KP_PERC,
  224. KP_LT,
  225. KP_GT,
  226. KP_AND,
  227. KP_LAZYAND,
  228. KP_OR,
  229. KP_LAZYOR,
  230. KP_COLON,
  231. KP_HASH,
  232. KP_SPACE,
  233. KP_ATMARK,
  234. KP_EXCLAMATION,
  235. KP_MEM_STORE,
  236. KP_MEM_RECALL,
  237. KP_MEM_CLEAR,
  238. KP_MEM_ADD,
  239. KP_MEM_SUB,
  240. KP_MEM_MUL,
  241. KP_MEM_DIV,
  242. KP_PLUS_MINUS,
  243. KP_CLEAR,
  244. KP_CLEAR_ENTRY,
  245. KP_BINARY,
  246. KP_OCTAL,
  247. KP_DECIMAL,
  248. KP_HEXADECIMAL,
  249. /* modifiers */
  250. KB_LCTRL = 0xE0, /* 0x01 */
  251. KB_LSHIFT, /* 0x02 */
  252. KB_LALT, /* 0x04 */
  253. KB_LGUI, /* 0x08 */
  254. KB_RCTRL, /* 0x10 */
  255. KB_RSHIFT, /* 0x20 */
  256. KB_RALT, /* 0x40 */
  257. KB_RGUI, /* 0x80 */
  258. /* extensions for internal use */
  259. FN_0 = 0xE8,
  260. FN_1,
  261. FN_2,
  262. FN_3,
  263. FN_4,
  264. FN_5,
  265. FN_6,
  266. FN_7,
  267. MS_UP = 0xF0,
  268. MS_DOWN,
  269. MS_LEFT,
  270. MS_RIGHT,
  271. MS_BTN1 = 0xF4,
  272. MS_BTN2,
  273. MS_BTN3,
  274. MS_BTN4,
  275. MS_BTN5,
  276. MS_WH_UP,
  277. MS_WH_DOWN,
  278. MS_WH_LEFT,
  279. MS_WH_RIGHT,
  280. };
  281. #endif /* USB_KEYCODES_H */