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.

usbkeycodes.h 5.2KB

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