Keyboard.cpp 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524
  1. /**
  2. * Copyright (c) 2006-2015 LOVE Development Team
  3. *
  4. * This software is provided 'as-is', without any express or implied
  5. * warranty. In no event will the authors be held liable for any damages
  6. * arising from the use of this software.
  7. *
  8. * Permission is granted to anyone to use this software for any purpose,
  9. * including commercial applications, and to alter it and redistribute it
  10. * freely, subject to the following restrictions:
  11. *
  12. * 1. The origin of this software must not be misrepresented; you must not
  13. * claim that you wrote the original software. If you use this software
  14. * in a product, an acknowledgment in the product documentation would be
  15. * appreciated but is not required.
  16. * 2. Altered source versions must be plainly marked as such, and must not be
  17. * misrepresented as being the original software.
  18. * 3. This notice may not be removed or altered from any source distribution.
  19. **/
  20. #include "common/config.h"
  21. #include "Keyboard.h"
  22. namespace love
  23. {
  24. namespace keyboard
  25. {
  26. bool Keyboard::getConstant(const char *in, Key &out)
  27. {
  28. return keys.find(in, out);
  29. }
  30. bool Keyboard::getConstant(Key in, const char *&out)
  31. {
  32. return keys.find(in, out);
  33. }
  34. bool Keyboard::getConstant(const char *in, Scancode &out)
  35. {
  36. return scancodes.find(in, out);
  37. }
  38. bool Keyboard::getConstant(Scancode in, const char *&out)
  39. {
  40. return scancodes.find(in, out);
  41. }
  42. StringMap<Keyboard::Key, Keyboard::KEY_MAX_ENUM>::Entry Keyboard::keyEntries[] =
  43. {
  44. {"unknown", Keyboard::KEY_UNKNOWN},
  45. {"return", Keyboard::KEY_RETURN},
  46. {"escape", Keyboard::KEY_ESCAPE},
  47. {"backspace", Keyboard::KEY_BACKSPACE},
  48. {"tab", Keyboard::KEY_TAB},
  49. {" ", Keyboard::KEY_SPACE},
  50. {"!", Keyboard::KEY_EXCLAIM},
  51. {"\"", Keyboard::KEY_QUOTEDBL},
  52. {"#", Keyboard::KEY_HASH},
  53. {"$", Keyboard::KEY_DOLLAR},
  54. {"&", Keyboard::KEY_AMPERSAND},
  55. {"'", Keyboard::KEY_QUOTE},
  56. {"(", Keyboard::KEY_LEFTPAREN},
  57. {")", Keyboard::KEY_RIGHTPAREN},
  58. {"*", Keyboard::KEY_ASTERISK},
  59. {"+", Keyboard::KEY_PLUS},
  60. {",", Keyboard::KEY_COMMA},
  61. {"-", Keyboard::KEY_MINUS},
  62. {".", Keyboard::KEY_PERIOD},
  63. {"/", Keyboard::KEY_SLASH},
  64. {"0", Keyboard::KEY_0},
  65. {"1", Keyboard::KEY_1},
  66. {"2", Keyboard::KEY_2},
  67. {"3", Keyboard::KEY_3},
  68. {"4", Keyboard::KEY_4},
  69. {"5", Keyboard::KEY_5},
  70. {"6", Keyboard::KEY_6},
  71. {"7", Keyboard::KEY_7},
  72. {"8", Keyboard::KEY_8},
  73. {"9", Keyboard::KEY_9},
  74. {":", Keyboard::KEY_COLON},
  75. {";", Keyboard::KEY_SEMICOLON},
  76. {"<", Keyboard::KEY_LESS},
  77. {"=", Keyboard::KEY_EQUALS},
  78. {">", Keyboard::KEY_GREATER},
  79. {"?", Keyboard::KEY_QUESTION},
  80. {"@", Keyboard::KEY_AT},
  81. {"[", Keyboard::KEY_LEFTBRACKET},
  82. {"\\", Keyboard::KEY_BACKSLASH},
  83. {"]", Keyboard::KEY_RIGHTBRACKET},
  84. {"^", Keyboard::KEY_CARET},
  85. {"_", Keyboard::KEY_UNDERSCORE},
  86. {"`", Keyboard::KEY_BACKQUOTE},
  87. {"a", Keyboard::KEY_A},
  88. {"b", Keyboard::KEY_B},
  89. {"c", Keyboard::KEY_C},
  90. {"d", Keyboard::KEY_D},
  91. {"e", Keyboard::KEY_E},
  92. {"f", Keyboard::KEY_F},
  93. {"g", Keyboard::KEY_G},
  94. {"h", Keyboard::KEY_H},
  95. {"i", Keyboard::KEY_I},
  96. {"j", Keyboard::KEY_J},
  97. {"k", Keyboard::KEY_K},
  98. {"l", Keyboard::KEY_L},
  99. {"m", Keyboard::KEY_M},
  100. {"n", Keyboard::KEY_N},
  101. {"o", Keyboard::KEY_O},
  102. {"p", Keyboard::KEY_P},
  103. {"q", Keyboard::KEY_Q},
  104. {"r", Keyboard::KEY_R},
  105. {"s", Keyboard::KEY_S},
  106. {"t", Keyboard::KEY_T},
  107. {"u", Keyboard::KEY_U},
  108. {"v", Keyboard::KEY_V},
  109. {"w", Keyboard::KEY_W},
  110. {"x", Keyboard::KEY_X},
  111. {"y", Keyboard::KEY_Y},
  112. {"z", Keyboard::KEY_Z},
  113. {"capslock", Keyboard::KEY_CAPSLOCK},
  114. {"f1", Keyboard::KEY_F1},
  115. {"f2", Keyboard::KEY_F2},
  116. {"f3", Keyboard::KEY_F3},
  117. {"f4", Keyboard::KEY_F4},
  118. {"f5", Keyboard::KEY_F5},
  119. {"f6", Keyboard::KEY_F6},
  120. {"f7", Keyboard::KEY_F7},
  121. {"f8", Keyboard::KEY_F8},
  122. {"f9", Keyboard::KEY_F9},
  123. {"f10", Keyboard::KEY_F10},
  124. {"f11", Keyboard::KEY_F11},
  125. {"f12", Keyboard::KEY_F12},
  126. {"printscreen", Keyboard::KEY_PRINTSCREEN},
  127. {"scrolllock", Keyboard::KEY_SCROLLLOCK},
  128. {"pause", Keyboard::KEY_PAUSE},
  129. {"insert", Keyboard::KEY_INSERT},
  130. {"home", Keyboard::KEY_HOME},
  131. {"pageup", Keyboard::KEY_PAGEUP},
  132. {"delete", Keyboard::KEY_DELETE},
  133. {"end", Keyboard::KEY_END},
  134. {"pagedown", Keyboard::KEY_PAGEDOWN},
  135. {"right", Keyboard::KEY_RIGHT},
  136. {"left", Keyboard::KEY_LEFT},
  137. {"down", Keyboard::KEY_DOWN},
  138. {"up", Keyboard::KEY_UP},
  139. {"numlock", Keyboard::KEY_NUMLOCKCLEAR},
  140. {"kp/", Keyboard::KEY_KP_DIVIDE},
  141. {"kp*", Keyboard::KEY_KP_MULTIPLY},
  142. {"kp-", Keyboard::KEY_KP_MINUS},
  143. {"kp+", Keyboard::KEY_KP_PLUS},
  144. {"kpenter", Keyboard::KEY_KP_ENTER},
  145. {"kp0", Keyboard::KEY_KP_0},
  146. {"kp1", Keyboard::KEY_KP_1},
  147. {"kp2", Keyboard::KEY_KP_2},
  148. {"kp3", Keyboard::KEY_KP_3},
  149. {"kp4", Keyboard::KEY_KP_4},
  150. {"kp5", Keyboard::KEY_KP_5},
  151. {"kp6", Keyboard::KEY_KP_6},
  152. {"kp7", Keyboard::KEY_KP_7},
  153. {"kp8", Keyboard::KEY_KP_8},
  154. {"kp9", Keyboard::KEY_KP_9},
  155. {"kp.", Keyboard::KEY_KP_PERIOD},
  156. {"kp,", Keyboard::KEY_KP_COMMA},
  157. {"kp=", Keyboard::KEY_KP_EQUALS},
  158. {"application", Keyboard::KEY_APPLICATION},
  159. {"power", Keyboard::KEY_POWER},
  160. {"f13", Keyboard::KEY_F13},
  161. {"f14", Keyboard::KEY_F14},
  162. {"f15", Keyboard::KEY_F15},
  163. {"f16", Keyboard::KEY_F16},
  164. {"f17", Keyboard::KEY_F17},
  165. {"f18", Keyboard::KEY_F18},
  166. {"f19", Keyboard::KEY_F19},
  167. {"f20", Keyboard::KEY_F20},
  168. {"f21", Keyboard::KEY_F21},
  169. {"f22", Keyboard::KEY_F22},
  170. {"f23", Keyboard::KEY_F23},
  171. {"f24", Keyboard::KEY_F24},
  172. {"execute", Keyboard::KEY_EXECUTE},
  173. {"help", Keyboard::KEY_HELP},
  174. {"menu", Keyboard::KEY_MENU},
  175. {"select", Keyboard::KEY_SELECT},
  176. {"stop", Keyboard::KEY_STOP},
  177. {"again", Keyboard::KEY_AGAIN},
  178. {"undo", Keyboard::KEY_UNDO},
  179. {"cut", Keyboard::KEY_CUT},
  180. {"copy", Keyboard::KEY_COPY},
  181. {"paste", Keyboard::KEY_PASTE},
  182. {"find", Keyboard::KEY_FIND},
  183. {"mute", Keyboard::KEY_MUTE},
  184. {"volumeup", Keyboard::KEY_VOLUMEUP},
  185. {"volumedown", Keyboard::KEY_VOLUMEDOWN},
  186. {"alterase", Keyboard::KEY_ALTERASE},
  187. {"sysreq", Keyboard::KEY_SYSREQ},
  188. {"cancel", Keyboard::KEY_CANCEL},
  189. {"clear", Keyboard::KEY_CLEAR},
  190. {"prior", Keyboard::KEY_PRIOR},
  191. {"return2", Keyboard::KEY_RETURN2},
  192. {"separator", Keyboard::KEY_SEPARATOR},
  193. {"out", Keyboard::KEY_OUT},
  194. {"oper", Keyboard::KEY_OPER},
  195. {"clearagain", Keyboard::KEY_CLEARAGAIN},
  196. {"thsousandsseparator", Keyboard::KEY_THOUSANDSSEPARATOR},
  197. {"decimalseparator", Keyboard::KEY_DECIMALSEPARATOR},
  198. {"currencyunit", Keyboard::KEY_CURRENCYUNIT},
  199. {"currencysubunit", Keyboard::KEY_CURRENCYSUBUNIT},
  200. {"lctrl", Keyboard::KEY_LCTRL},
  201. {"lshift", Keyboard::KEY_LSHIFT},
  202. {"lalt", Keyboard::KEY_LALT},
  203. {"lgui", Keyboard::KEY_LGUI},
  204. {"rctrl", Keyboard::KEY_RCTRL},
  205. {"rshift", Keyboard::KEY_RSHIFT},
  206. {"ralt", Keyboard::KEY_RALT},
  207. {"rgui", Keyboard::KEY_RGUI},
  208. {"mode", Keyboard::KEY_MODE},
  209. {"audionext", Keyboard::KEY_AUDIONEXT},
  210. {"audioprev", Keyboard::KEY_AUDIOPREV},
  211. {"audiostop", Keyboard::KEY_AUDIOSTOP},
  212. {"audioplay", Keyboard::KEY_AUDIOPLAY},
  213. {"audiomute", Keyboard::KEY_AUDIOMUTE},
  214. {"mediaselect", Keyboard::KEY_MEDIASELECT},
  215. {"www", Keyboard::KEY_WWW},
  216. {"mail", Keyboard::KEY_MAIL},
  217. {"calculator", Keyboard::KEY_CALCULATOR},
  218. {"computer", Keyboard::KEY_COMPUTER},
  219. {"appsearch", Keyboard::KEY_APP_SEARCH},
  220. {"apphome", Keyboard::KEY_APP_HOME},
  221. {"appback", Keyboard::KEY_APP_BACK},
  222. {"appforward", Keyboard::KEY_APP_FORWARD},
  223. {"appstop", Keyboard::KEY_APP_STOP},
  224. {"apprefresh", Keyboard::KEY_APP_REFRESH},
  225. {"appbookmarks", Keyboard::KEY_APP_BOOKMARKS},
  226. {"brightnessdown", Keyboard::KEY_BRIGHTNESSDOWN},
  227. {"brightnessup", Keyboard::KEY_BRIGHTNESSUP},
  228. {"displayswitch", Keyboard::KEY_DISPLAYSWITCH},
  229. {"kbdillumtoggle", Keyboard::KEY_KBDILLUMTOGGLE},
  230. {"kbdillumdown", Keyboard::KEY_KBDILLUMDOWN},
  231. {"kbdillumup", Keyboard::KEY_KBDILLUMUP},
  232. {"eject", Keyboard::KEY_EJECT},
  233. {"sleep", Keyboard::KEY_SLEEP},
  234. };
  235. StringMap<Keyboard::Key, Keyboard::KEY_MAX_ENUM> Keyboard::keys(Keyboard::keyEntries, sizeof(Keyboard::keyEntries));
  236. StringMap<Keyboard::Scancode, Keyboard::SCANCODE_MAX_ENUM>::Entry Keyboard::scancodeEntries[] =
  237. {
  238. {"unknown", SCANCODE_UNKNOWN},
  239. {"a", SCANCODE_A},
  240. {"b", SCANCODE_B},
  241. {"c", SCANCODE_C},
  242. {"d", SCANCODE_D},
  243. {"e", SCANCODE_E},
  244. {"f", SCANCODE_F},
  245. {"g", SCANCODE_G},
  246. {"h", SCANCODE_H},
  247. {"i", SCANCODE_I},
  248. {"j", SCANCODE_J},
  249. {"k", SCANCODE_K},
  250. {"l", SCANCODE_L},
  251. {"m", SCANCODE_M},
  252. {"n", SCANCODE_N},
  253. {"o", SCANCODE_O},
  254. {"p", SCANCODE_P},
  255. {"q", SCANCODE_Q},
  256. {"r", SCANCODE_R},
  257. {"s", SCANCODE_S},
  258. {"t", SCANCODE_T},
  259. {"u", SCANCODE_U},
  260. {"v", SCANCODE_V},
  261. {"w", SCANCODE_W},
  262. {"x", SCANCODE_X},
  263. {"y", SCANCODE_Y},
  264. {"z", SCANCODE_Z},
  265. {"1", SCANCODE_1},
  266. {"2", SCANCODE_2},
  267. {"3", SCANCODE_3},
  268. {"4", SCANCODE_4},
  269. {"5", SCANCODE_5},
  270. {"6", SCANCODE_6},
  271. {"7", SCANCODE_7},
  272. {"8", SCANCODE_8},
  273. {"9", SCANCODE_9},
  274. {"0", SCANCODE_0},
  275. {"return", SCANCODE_RETURN},
  276. {"escape", SCANCODE_ESCAPE},
  277. {"backspace", SCANCODE_BACKSPACE},
  278. {"tab", SCANCODE_TAB},
  279. {" ", SCANCODE_SPACE},
  280. {"-", SCANCODE_MINUS},
  281. {"=", SCANCODE_EQUALS},
  282. {"[", SCANCODE_LEFTBRACKET},
  283. {"]", SCANCODE_RIGHTBRACKET},
  284. {"\\", SCANCODE_BACKSLASH},
  285. {"nonus#", SCANCODE_NONUSHASH},
  286. {";", SCANCODE_SEMICOLON},
  287. {"'", SCANCODE_APOSTROPHE},
  288. {"`", SCANCODE_GRAVE},
  289. {",", SCANCODE_COMMA},
  290. {".", SCANCODE_PERIOD},
  291. {"/", SCANCODE_SLASH},
  292. {"capslock", SCANCODE_CAPSLOCK},
  293. {"f1", SCANCODE_F1},
  294. {"f2", SCANCODE_F2},
  295. {"f3", SCANCODE_F3},
  296. {"f4", SCANCODE_F4},
  297. {"f5", SCANCODE_F5},
  298. {"f6", SCANCODE_F6},
  299. {"f7", SCANCODE_F7},
  300. {"f8", SCANCODE_F8},
  301. {"f9", SCANCODE_F9},
  302. {"f10", SCANCODE_F10},
  303. {"f11", SCANCODE_F11},
  304. {"f12", SCANCODE_F12},
  305. {"printscreen", SCANCODE_PRINTSCREEN},
  306. {"scrolllock", SCANCODE_SCROLLLOCK},
  307. {"pause", SCANCODE_PAUSE},
  308. {"insert", SCANCODE_INSERT},
  309. {"home", SCANCODE_HOME},
  310. {"pageup", SCANCODE_PAGEUP},
  311. {"delete", SCANCODE_DELETE},
  312. {"end", SCANCODE_END},
  313. {"pagedown", SCANCODE_PAGEDOWN},
  314. {"right", SCANCODE_RIGHT},
  315. {"left", SCANCODE_LEFT},
  316. {"down", SCANCODE_DOWN},
  317. {"up", SCANCODE_UP},
  318. {"numlock", SCANCODE_NUMLOCKCLEAR},
  319. {"kp/", SCANCODE_KP_DIVIDE},
  320. {"kp*", SCANCODE_KP_MULTIPLY},
  321. {"kp-", SCANCODE_KP_MINUS},
  322. {"kp+", SCANCODE_KP_PLUS},
  323. {"kpenter", SCANCODE_KP_ENTER},
  324. {"kp1", SCANCODE_KP_1},
  325. {"kp2", SCANCODE_KP_2},
  326. {"kp3", SCANCODE_KP_3},
  327. {"kp4", SCANCODE_KP_4},
  328. {"kp5", SCANCODE_KP_5},
  329. {"kp6", SCANCODE_KP_6},
  330. {"kp7", SCANCODE_KP_7},
  331. {"kp8", SCANCODE_KP_8},
  332. {"kp9", SCANCODE_KP_9},
  333. {"kp0", SCANCODE_KP_0},
  334. {"kp.", SCANCODE_KP_PERIOD},
  335. {"nonusbackslash", SCANCODE_NONUSBACKSLASH},
  336. {"application", SCANCODE_APPLICATION},
  337. {"power", SCANCODE_POWER},
  338. {"=", SCANCODE_KP_EQUALS},
  339. {"f13", SCANCODE_F13},
  340. {"f14", SCANCODE_F14},
  341. {"f15", SCANCODE_F15},
  342. {"f16", SCANCODE_F16},
  343. {"f17", SCANCODE_F17},
  344. {"f18", SCANCODE_F18},
  345. {"f19", SCANCODE_F19},
  346. {"f20", SCANCODE_F20},
  347. {"f21", SCANCODE_F21},
  348. {"f22", SCANCODE_F22},
  349. {"f23", SCANCODE_F23},
  350. {"f24", SCANCODE_F24},
  351. {"execute", SCANCODE_EXECUTE},
  352. {"help", SCANCODE_HELP},
  353. {"menu", SCANCODE_MENU},
  354. {"select", SCANCODE_SELECT},
  355. {"stop", SCANCODE_STOP},
  356. {"again", SCANCODE_AGAIN},
  357. {"undo", SCANCODE_UNDO},
  358. {"cut", SCANCODE_CUT},
  359. {"copy", SCANCODE_COPY},
  360. {"paste", SCANCODE_PASTE},
  361. {"find", SCANCODE_FIND},
  362. {"mute", SCANCODE_MUTE},
  363. {"volumeup", SCANCODE_VOLUMEUP},
  364. {"volumedown", SCANCODE_VOLUMEDOWN},
  365. {"kp,", SCANCODE_KP_COMMA},
  366. {"kp=400", SCANCODE_KP_EQUALSAS400},
  367. {"international1", SCANCODE_INTERNATIONAL1},
  368. {"international2", SCANCODE_INTERNATIONAL2},
  369. {"international3", SCANCODE_INTERNATIONAL3},
  370. {"international4", SCANCODE_INTERNATIONAL4},
  371. {"international5", SCANCODE_INTERNATIONAL5},
  372. {"international6", SCANCODE_INTERNATIONAL6},
  373. {"international7", SCANCODE_INTERNATIONAL7},
  374. {"international8", SCANCODE_INTERNATIONAL8},
  375. {"international9", SCANCODE_INTERNATIONAL9},
  376. {"lang1", SCANCODE_LANG1},
  377. {"lang2", SCANCODE_LANG2},
  378. {"lang3", SCANCODE_LANG3},
  379. {"lang4", SCANCODE_LANG4},
  380. {"lang5", SCANCODE_LANG5},
  381. {"lang6", SCANCODE_LANG6},
  382. {"lang7", SCANCODE_LANG7},
  383. {"lang8", SCANCODE_LANG8},
  384. {"lang9", SCANCODE_LANG9},
  385. {"alterase", SCANCODE_ALTERASE},
  386. {"sysreq", SCANCODE_SYSREQ},
  387. {"cancel", SCANCODE_CANCEL},
  388. {"clear", SCANCODE_CLEAR},
  389. {"prior", SCANCODE_PRIOR},
  390. {"return2", SCANCODE_RETURN2},
  391. {"separator", SCANCODE_SEPARATOR},
  392. {"out", SCANCODE_OUT},
  393. {"oper", SCANCODE_OPER},
  394. {"clearagain", SCANCODE_CLEARAGAIN},
  395. {"crsel", SCANCODE_CRSEL},
  396. {"exsel", SCANCODE_EXSEL},
  397. {"kp00", SCANCODE_KP_00},
  398. {"kp000", SCANCODE_KP_000},
  399. {"thsousandsseparator", SCANCODE_THOUSANDSSEPARATOR},
  400. {"decimalseparator", SCANCODE_DECIMALSEPARATOR},
  401. {"currencyunit", SCANCODE_CURRENCYUNIT},
  402. {"currencysubunit", SCANCODE_CURRENCYSUBUNIT},
  403. {"kp(", SCANCODE_KP_LEFTPAREN},
  404. {"kp)", SCANCODE_KP_RIGHTPAREN},
  405. {"kp{", SCANCODE_KP_LEFTBRACE},
  406. {"kp}", SCANCODE_KP_RIGHTBRACE},
  407. {"kptab", SCANCODE_KP_TAB},
  408. {"kpbackspace", SCANCODE_KP_BACKSPACE},
  409. {"kpa", SCANCODE_KP_A},
  410. {"kpb", SCANCODE_KP_B},
  411. {"kpc", SCANCODE_KP_C},
  412. {"kpd", SCANCODE_KP_D},
  413. {"kpe", SCANCODE_KP_E},
  414. {"kpf", SCANCODE_KP_F},
  415. {"kpxor", SCANCODE_KP_XOR},
  416. {"kpower", SCANCODE_KP_POWER},
  417. {"kp%", SCANCODE_KP_PERCENT},
  418. {"kp<", SCANCODE_KP_LESS},
  419. {"kp>", SCANCODE_KP_GREATER},
  420. {"kp&", SCANCODE_KP_AMPERSAND},
  421. {"kp&&", SCANCODE_KP_DBLAMPERSAND},
  422. {"kp|", SCANCODE_KP_VERTICALBAR},
  423. {"kp||", SCANCODE_KP_DBLVERTICALBAR},
  424. {"kp:", SCANCODE_KP_COLON},
  425. {"kp#", SCANCODE_KP_HASH},
  426. {"kp ", SCANCODE_KP_SPACE},
  427. {"kp@", SCANCODE_KP_AT},
  428. {"kp!", SCANCODE_KP_EXCLAM},
  429. {"kpmemstore", SCANCODE_KP_MEMSTORE},
  430. {"kpmemrecall", SCANCODE_KP_MEMRECALL},
  431. {"kpmemclear", SCANCODE_KP_MEMCLEAR},
  432. {"kpmem+", SCANCODE_KP_MEMADD},
  433. {"kpmem-", SCANCODE_KP_MEMSUBTRACT},
  434. {"kpmem*", SCANCODE_KP_MEMMULTIPLY},
  435. {"kpmem/", SCANCODE_KP_MEMDIVIDE},
  436. {"kp+-", SCANCODE_KP_PLUSMINUS},
  437. {"kpclear", SCANCODE_KP_CLEAR},
  438. {"kpclearentry", SCANCODE_KP_CLEARENTRY},
  439. {"kpbinary", SCANCODE_KP_BINARY},
  440. {"kpoctal", SCANCODE_KP_OCTAL},
  441. {"kpdecimal", SCANCODE_KP_DECIMAL},
  442. {"kphex", SCANCODE_KP_HEXADECIMAL},
  443. {"lctrl", SCANCODE_LCTRL},
  444. {"lshift", SCANCODE_LSHIFT},
  445. {"lalt", SCANCODE_LALT},
  446. {"lgui", SCANCODE_LGUI},
  447. {"rctrl", SCANCODE_RCTRL},
  448. {"rshift", SCANCODE_RSHIFT},
  449. {"ralt", SCANCODE_RALT},
  450. {"rgui", SCANCODE_RGUI},
  451. {"mode", SCANCODE_MODE},
  452. {"audionext", SCANCODE_AUDIONEXT},
  453. {"audioprev", SCANCODE_AUDIOPREV},
  454. {"audiostop", SCANCODE_AUDIOSTOP},
  455. {"audioplay", SCANCODE_AUDIOPLAY},
  456. {"audiomute", SCANCODE_AUDIOMUTE},
  457. {"mediaselect", SCANCODE_MEDIASELECT},
  458. {"www", SCANCODE_WWW},
  459. {"mail", SCANCODE_MAIL},
  460. {"calculator", SCANCODE_CALCULATOR},
  461. {"computer", SCANCODE_COMPUTER},
  462. {"acsearch", SCANCODE_AC_SEARCH},
  463. {"achome", SCANCODE_AC_HOME},
  464. {"acback", SCANCODE_AC_BACK},
  465. {"acforward", SCANCODE_AC_FORWARD},
  466. {"acstop", SCANCODE_AC_STOP},
  467. {"acrefresh", SCANCODE_AC_REFRESH},
  468. {"acbookmarks", SCANCODE_AC_BOOKMARKS},
  469. {"brightnessdown", SCANCODE_BRIGHTNESSDOWN},
  470. {"brightnessup", SCANCODE_BRIGHTNESSUP},
  471. {"displayswitch", SCANCODE_DISPLAYSWITCH},
  472. {"kbdillumtoggle", SCANCODE_KBDILLUMTOGGLE},
  473. {"kbdillumdown", SCANCODE_KBDILLUMDOWN},
  474. {"kbdillumup", SCANCODE_KBDILLUMUP},
  475. {"eject", SCANCODE_EJECT},
  476. {"sleep", SCANCODE_SLEEP},
  477. {"app1", SCANCODE_APP1},
  478. {"app2", SCANCODE_APP2},
  479. };
  480. StringMap<Keyboard::Scancode, Keyboard::SCANCODE_MAX_ENUM> Keyboard::scancodes(Keyboard::scancodeEntries, sizeof(Keyboard::scancodeEntries));
  481. } // keyboard
  482. } // love