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