0 | {- Tian Z (ecburx@burx.vip) -}
  1 |
  2 | module IdrisGL.SDL.SDL_keycode
  3 |
  4 | ||| All supported key events.
  5 | public export
  6 | data Key
  7 |   = EK_UNKNOWN
  8 |
  9 |   | EK_RETURN
 10 |   | EK_ESCAPE
 11 |   | EK_BACKSPACE
 12 |   | EK_TAB
 13 |   | EK_SPACE
 14 |   | EK_EXCLAIM
 15 |   | EK_QUOTEDBL
 16 |   | EK_HASH
 17 |   | EK_PERCENT
 18 |   | EK_DOLLAR
 19 |   | EK_AMPERSAND
 20 |   | EK_QUOTE
 21 |   | EK_LEFTPAREN
 22 |   | EK_RIGHTPAREN
 23 |   | EK_ASTERISK
 24 |   | EK_PLUS
 25 |   | EK_COMMA
 26 |   | EK_MINUS
 27 |   | EK_PERIOD
 28 |   | EK_SLASH
 29 |   | EK_0
 30 |   | EK_1
 31 |   | EK_2
 32 |   | EK_3
 33 |   | EK_4
 34 |   | EK_5
 35 |   | EK_6
 36 |   | EK_7
 37 |   | EK_8
 38 |   | EK_9
 39 |   | EK_COLON
 40 |   | EK_SEMICOLON
 41 |   | EK_LESS
 42 |   | EK_EQUALS
 43 |   | EK_GREATER
 44 |   | EK_QUESTION
 45 |   | EK_AT
 46 |
 47 |   -- Skip upper letters.
 48 |
 49 |   | EK_LEFTBRACKET
 50 |   | EK_BACKSLASH
 51 |   | EK_RIGHTBRACKET
 52 |   | EK_CARET
 53 |   | EK_UNDERSCORE
 54 |   | EK_BACKQUOTE
 55 |   | EK_a
 56 |   | EK_b
 57 |   | EK_c
 58 |   | EK_d
 59 |   | EK_e
 60 |   | EK_f
 61 |   | EK_g
 62 |   | EK_h
 63 |   | EK_i
 64 |   | EK_j
 65 |   | EK_k
 66 |   | EK_l
 67 |   | EK_m
 68 |   | EK_n
 69 |   | EK_o
 70 |   | EK_p
 71 |   | EK_q
 72 |   | EK_r
 73 |   | EK_s
 74 |   | EK_t
 75 |   | EK_u
 76 |   | EK_v
 77 |   | EK_w
 78 |   | EK_x
 79 |   | EK_y
 80 |   | EK_z
 81 |
 82 |   | EK_CAPSLOCK
 83 |
 84 |   | EK_F1
 85 |   | EK_F2
 86 |   | EK_F3
 87 |   | EK_F4
 88 |   | EK_F5
 89 |   | EK_F6
 90 |   | EK_F7
 91 |   | EK_F8
 92 |   | EK_F9
 93 |   | EK_F10
 94 |   | EK_F11
 95 |   | EK_F12
 96 |
 97 |   | EK_PRINTSCREEN
 98 |   | EK_SCROLLLOCK
 99 |   | EK_PAUSE
100 |   | EK_INSERT
101 |   | EK_HOME
102 |   | EK_PAGEUP
103 |   | EK_DELETE
104 |   | EK_END
105 |   | EK_PAGEDOWN
106 |   | EK_RIGHT
107 |   | EK_LEFT
108 |   | EK_DOWN
109 |   | EK_UP
110 |
111 |   | EK_NUMLOCKCLEAR
112 |   | EK_KP_DIVIDE
113 |   | EK_KP_MULTIPLY
114 |   | EK_KP_MINUS
115 |   | EK_KP_PLUS
116 |   | EK_KP_ENTER
117 |   | EK_KP_1
118 |   | EK_KP_2
119 |   | EK_KP_3
120 |   | EK_KP_4
121 |   | EK_KP_5
122 |   | EK_KP_6
123 |   | EK_KP_7
124 |   | EK_KP_8
125 |   | EK_KP_9
126 |   | EK_KP_0
127 |   | EK_KP_PERIOD
128 |
129 |   | EK_APPLICATION
130 |   | EK_POWER
131 |   | EK_KP_EQUALS
132 |   | EK_F13
133 |   | EK_F14
134 |   | EK_F15
135 |   | EK_F16
136 |   | EK_F17
137 |   | EK_F18
138 |   | EK_F19
139 |   | EK_F20
140 |   | EK_F21
141 |   | EK_F22
142 |   | EK_F23
143 |   | EK_F24
144 |   | EK_EXECUTE
145 |   | EK_HELP
146 |   | EK_MENU
147 |   | EK_SELECT
148 |   | EK_STOP
149 |   | EK_AGAIN
150 |   | EK_UNDO
151 |   | EK_CUT
152 |   | EK_COPY
153 |   | EK_PASTE
154 |   | EK_FIND
155 |   | EK_MUTE
156 |   | EK_VOLUMEUP
157 |   | EK_VOLUMEDOWN
158 |   | EK_KP_COMMA
159 |   | EK_KP_EQUALSAS400
160 |
161 |   | EK_ALTERASE
162 |   | EK_SYSREQ
163 |   | EK_CANCEL
164 |   | EK_CLEAR
165 |   | EK_PRIOR
166 |   | EK_RETURN2
167 |   | EK_SEPARATOR
168 |   | EK_OUT
169 |   | EK_OPER
170 |   | EK_CLEARAGAIN
171 |   | EK_CRSEL
172 |   | EK_EXSEL
173 |
174 |   | EK_KP_00
175 |   | EK_KP_000
176 |   | EK_THOUSANDSSEPARATOR
177 |   | EK_DECIMALSEPARATOR
178 |   | EK_CURRENCYUNIT
179 |   | EK_CURRENCYSUBUNIT
180 |   | EK_KP_LEFTPAREN
181 |   | EK_KP_RIGHTPAREN
182 |   | EK_KP_LEFTBRACE
183 |   | EK_KP_RIGHTBRACE
184 |   | EK_KP_TAB
185 |   | EK_KP_BACKSPACE
186 |   | EK_KP_A
187 |   | EK_KP_B
188 |   | EK_KP_C
189 |   | EK_KP_D
190 |   | EK_KP_E
191 |   | EK_KP_F
192 |   | EK_KP_XOR
193 |   | EK_KP_POWER
194 |   | EK_KP_PERCENT
195 |   | EK_KP_LESS
196 |   | EK_KP_GREATER
197 |   | EK_KP_AMPERSAND
198 |   | EK_KP_DBLAMPERSAND
199 |   | EK_KP_VERTICALBAR
200 |   | EK_KP_DBLVERTICALBAR
201 |   | EK_KP_COLON
202 |   | EK_KP_HASH
203 |   | EK_KP_SPACE
204 |   | EK_KP_AT
205 |   | EK_KP_EXCLAM
206 |   | EK_KP_MEMSTORE
207 |   | EK_KP_MEMRECALL
208 |   | EK_KP_MEMCLEAR
209 |   | EK_KP_MEMADD
210 |   | EK_KP_MEMSUBTRACT
211 |   | EK_KP_MEMMULTIPLY
212 |   | EK_KP_MEMDIVIDE
213 |   | EK_KP_PLUSMINUS
214 |   | EK_KP_CLEAR
215 |   | EK_KP_CLEARENTRY
216 |   | EK_KP_BINARY
217 |   | EK_KP_OCTAL
218 |   | EK_KP_DECIMAL
219 |   | EK_KP_HEXADECIMAL
220 |
221 |   | EK_LCTRL
222 |   | EK_LSHIFT
223 |   | EK_LALT
224 |   | EK_LGUI
225 |   | EK_RCTRL
226 |   | EK_RSHIFT
227 |   | EK_RALT
228 |   | EK_RGUI
229 |
230 |   | EK_MODE
231 |
232 |   | EK_AUDIONEXT
233 |   | EK_AUDIOPREV
234 |   | EK_AUDIOSTOP
235 |   | EK_AUDIOPLAY
236 |   | EK_AUDIOMUTE
237 |   | EK_MEDIASELECT
238 |   | EK_WWW
239 |   | EK_MAIL
240 |   | EK_CALCULATOR
241 |   | EK_COMPUTER
242 |   | EK_AC_SEARCH
243 |   | EK_AC_HOME
244 |   | EK_AC_BACK
245 |   | EK_AC_FORWARD
246 |   | EK_AC_STOP
247 |   | EK_AC_REFRESH
248 |   | EK_AC_BOOKMARKS
249 |
250 |   | EK_BRIGHTNESSDOWN
251 |   | EK_BRIGHTNESSUP
252 |   | EK_DISPLAYSWITCH
253 |   | EK_KBDILLUMTOGGLE
254 |   | EK_KBDILLUMDOWN
255 |   | EK_KBDILLUMUP
256 |   | EK_EJECT
257 |   | EK_SLEEP
258 |   | EK_APP1
259 |   | EK_APP2
260 |
261 |   | EK_AUDIOREWIND
262 |   | EK_AUDIOFASTFORWARD
263 |
264 | export
265 | getKey : Int -> Key
266 | getKey 13           = EK_RETURN
267 | getKey 27           = EK_ESCAPE
268 | getKey 8            = EK_BACKSPACE
269 | getKey 9            = EK_TAB
270 | getKey 32           = EK_SPACE
271 | getKey 33           = EK_EXCLAIM
272 | getKey 34           = EK_QUOTEDBL
273 | getKey 35           = EK_HASH
274 | getKey 37           = EK_PERCENT
275 | getKey 36           = EK_DOLLAR
276 | getKey 38           = EK_AMPERSAND
277 | getKey 39           = EK_QUOTE
278 | getKey 40           = EK_LEFTPAREN
279 | getKey 41           = EK_RIGHTPAREN
280 | getKey 42           = EK_ASTERISK
281 | getKey 43           = EK_PLUS
282 | getKey 44           = EK_COMMA
283 | getKey 45           = EK_MINUS
284 | getKey 46           = EK_PERIOD
285 | getKey 47           = EK_SLASH
286 | getKey 48           = EK_0
287 | getKey 49           = EK_1
288 | getKey 50           = EK_2
289 | getKey 51           = EK_3
290 | getKey 52           = EK_4
291 | getKey 53           = EK_5
292 | getKey 54           = EK_6
293 | getKey 55           = EK_7
294 | getKey 56           = EK_8
295 | getKey 57           = EK_9
296 | getKey 58           = EK_COLON
297 | getKey 59           = EK_SEMICOLON
298 | getKey 60           = EK_LESS
299 | getKey 61           = EK_EQUALS
300 | getKey 62           = EK_GREATER
301 | getKey 63           = EK_QUESTION
302 | getKey 64           = EK_AT
303 |
304 | getKey 91           = EK_LEFTBRACKET
305 | getKey 92           = EK_BACKSLASH
306 | getKey 93           = EK_RIGHTBRACKET
307 | getKey 94           = EK_CARET
308 | getKey 95           = EK_UNDERSCORE
309 | getKey 96           = EK_BACKQUOTE
310 | getKey 97           = EK_a
311 | getKey 98           = EK_b
312 | getKey 99           = EK_c
313 | getKey 100          = EK_d
314 | getKey 101          = EK_e
315 | getKey 102          = EK_f
316 | getKey 103          = EK_g
317 | getKey 104          = EK_h
318 | getKey 105          = EK_i
319 | getKey 106          = EK_j
320 | getKey 107          = EK_k
321 | getKey 108          = EK_l
322 | getKey 109          = EK_m
323 | getKey 110          = EK_n
324 | getKey 111          = EK_o
325 | getKey 112          = EK_p
326 | getKey 113          = EK_q
327 | getKey 114          = EK_r
328 | getKey 115          = EK_s
329 | getKey 116          = EK_t
330 | getKey 117          = EK_u
331 | getKey 118          = EK_v
332 | getKey 119          = EK_w
333 | getKey 120          = EK_x
334 | getKey 121          = EK_y
335 | getKey 122          = EK_z
336 |
337 | getKey 1073741881   = EK_CAPSLOCK
338 |
339 | getKey 1073741882   = EK_F1
340 | getKey 1073741883   = EK_F2
341 | getKey 1073741884   = EK_F3
342 | getKey 1073741885   = EK_F4
343 | getKey 1073741886   = EK_F5
344 | getKey 1073741887   = EK_F6
345 | getKey 1073741888   = EK_F7
346 | getKey 1073741889   = EK_F8
347 | getKey 1073741890   = EK_F9
348 | getKey 1073741891   = EK_F10
349 | getKey 1073741892   = EK_F11
350 | getKey 1073741893   = EK_F12
351 |
352 | getKey 1073741894   = EK_PRINTSCREEN
353 | getKey 1073741895   = EK_SCROLLLOCK
354 | getKey 1073741896   = EK_PAUSE
355 | getKey 1073741897   = EK_INSERT
356 | getKey 1073741898   = EK_HOME
357 | getKey 1073741899   = EK_PAGEUP
358 | getKey 127          = EK_DELETE
359 | getKey 1073741901   = EK_END
360 | getKey 1073741902   = EK_PAGEDOWN
361 | getKey 1073741903   = EK_RIGHT
362 | getKey 1073741904   = EK_LEFT
363 | getKey 1073741905   = EK_DOWN
364 | getKey 1073741906   = EK_UP
365 |
366 | getKey 1073741907   = EK_NUMLOCKCLEAR
367 | getKey 1073741908   = EK_KP_DIVIDE
368 | getKey 1073741909   = EK_KP_MULTIPLY
369 | getKey 1073741910   = EK_KP_MINUS
370 | getKey 1073741911   = EK_KP_PLUS
371 | getKey 1073741912   = EK_KP_ENTER
372 | getKey 1073741913   = EK_KP_1
373 | getKey 1073741914   = EK_KP_2
374 | getKey 1073741915   = EK_KP_3
375 | getKey 1073741916   = EK_KP_4
376 | getKey 1073741917   = EK_KP_5
377 | getKey 1073741918   = EK_KP_6
378 | getKey 1073741919   = EK_KP_7
379 | getKey 1073741920   = EK_KP_8
380 | getKey 1073741921   = EK_KP_9
381 | getKey 1073741922   = EK_KP_0
382 | getKey 1073741923   = EK_KP_PERIOD
383 |
384 | getKey 1073741925   = EK_APPLICATION
385 | getKey 1073741926   = EK_POWER
386 | getKey 1073741927   = EK_KP_EQUALS
387 | getKey 1073741928   = EK_F13
388 | getKey 1073741929   = EK_F14
389 | getKey 1073741930   = EK_F15
390 | getKey 1073741931   = EK_F16
391 | getKey 1073741932   = EK_F17
392 | getKey 1073741933   = EK_F18
393 | getKey 1073741934   = EK_F19
394 | getKey 1073741935   = EK_F20
395 | getKey 1073741936   = EK_F21
396 | getKey 1073741937   = EK_F22
397 | getKey 1073741938   = EK_F23
398 | getKey 1073741939   = EK_F24
399 | getKey 1073741940   = EK_EXECUTE
400 | getKey 1073741941   = EK_HELP
401 | getKey 1073741942   = EK_MENU
402 | getKey 1073741943   = EK_SELECT
403 | getKey 1073741944   = EK_STOP
404 | getKey 1073741945   = EK_AGAIN
405 | getKey 1073741946   = EK_UNDO
406 | getKey 1073741947   = EK_CUT
407 | getKey 1073741948   = EK_COPY
408 | getKey 1073741949   = EK_PASTE
409 | getKey 1073741950   = EK_FIND
410 | getKey 1073741951   = EK_MUTE
411 | getKey 1073741952   = EK_VOLUMEUP
412 | getKey 1073741953   = EK_VOLUMEDOWN
413 | getKey 1073741957   = EK_KP_COMMA
414 | getKey 1073741958   = EK_KP_EQUALSAS400
415 |
416 | getKey 1073741977   = EK_ALTERASE
417 | getKey 1073741978   = EK_SYSREQ
418 | getKey 1073741979   = EK_CANCEL
419 | getKey 1073741980   = EK_CLEAR
420 | getKey 1073741981   = EK_PRIOR
421 | getKey 1073741982   = EK_RETURN2
422 | getKey 1073741983   = EK_SEPARATOR
423 | getKey 1073741984   = EK_OUT
424 | getKey 1073741985   = EK_OPER
425 | getKey 1073741986   = EK_CLEARAGAIN
426 | getKey 1073741987   = EK_CRSEL
427 | getKey 1073741988   = EK_EXSEL
428 |
429 | getKey 1073742000   = EK_KP_00
430 | getKey 1073742001   = EK_KP_000
431 | getKey 1073742002   = EK_THOUSANDSSEPARATOR
432 | getKey 1073742003   = EK_DECIMALSEPARATOR
433 | getKey 1073742004   = EK_CURRENCYUNIT
434 | getKey 1073742005   = EK_CURRENCYSUBUNIT
435 | getKey 1073742006   = EK_KP_LEFTPAREN
436 | getKey 1073742007   = EK_KP_RIGHTPAREN
437 | getKey 1073742008   = EK_KP_LEFTBRACE
438 | getKey 1073742009   = EK_KP_RIGHTBRACE
439 | getKey 1073742010   = EK_KP_TAB
440 | getKey 1073742011   = EK_KP_BACKSPACE
441 | getKey 1073742012   = EK_KP_A
442 | getKey 1073742013   = EK_KP_B
443 | getKey 1073742014   = EK_KP_C
444 | getKey 1073742015   = EK_KP_D
445 | getKey 1073742016   = EK_KP_E
446 | getKey 1073742017   = EK_KP_F
447 | getKey 1073742018   = EK_KP_XOR
448 | getKey 1073742019   = EK_KP_POWER
449 | getKey 1073742020   = EK_KP_PERCENT
450 | getKey 1073742021   = EK_KP_LESS
451 | getKey 1073742022   = EK_KP_GREATER
452 | getKey 1073742023   = EK_KP_AMPERSAND
453 | getKey 1073742024   = EK_KP_DBLAMPERSAND
454 | getKey 1073742025   = EK_KP_VERTICALBAR
455 | getKey 1073742026   = EK_KP_DBLVERTICALBAR
456 | getKey 1073742027   = EK_KP_COLON
457 | getKey 1073742028   = EK_KP_HASH
458 | getKey 1073742029   = EK_KP_SPACE
459 | getKey 1073742030   = EK_KP_AT
460 | getKey 1073742031   = EK_KP_EXCLAM
461 | getKey 1073742032   = EK_KP_MEMSTORE
462 | getKey 1073742033   = EK_KP_MEMRECALL
463 | getKey 1073742034   = EK_KP_MEMCLEAR
464 | getKey 1073742035   = EK_KP_MEMADD
465 | getKey 1073742036   = EK_KP_MEMSUBTRACT
466 | getKey 1073742037   = EK_KP_MEMMULTIPLY
467 | getKey 1073742038   = EK_KP_MEMDIVIDE
468 | getKey 1073742039   = EK_KP_PLUSMINUS
469 | getKey 1073742040   = EK_KP_CLEAR
470 | getKey 1073742041   = EK_KP_CLEARENTRY
471 | getKey 1073742042   = EK_KP_BINARY
472 | getKey 1073742043   = EK_KP_OCTAL
473 | getKey 1073742044   = EK_KP_DECIMAL
474 | getKey 1073742045   = EK_KP_HEXADECIMAL
475 |
476 | getKey 1073742048   = EK_LCTRL
477 | getKey 1073742049   = EK_LSHIFT
478 | getKey 1073742050   = EK_LALT
479 | getKey 1073742051   = EK_LGUI
480 | getKey 1073742052   = EK_RCTRL
481 | getKey 1073742053   = EK_RSHIFT
482 | getKey 1073742054   = EK_RALT
483 | getKey 1073742055   = EK_RGUI
484 |
485 | getKey 1073742081   = EK_MODE
486 |
487 | getKey 1073742082 = EK_AUDIONEXT
488 | getKey 1073742083 = EK_AUDIOPREV
489 | getKey 1073742084 = EK_AUDIOSTOP
490 | getKey 1073742085 = EK_AUDIOPLAY
491 | getKey 1073742086 = EK_AUDIOMUTE
492 | getKey 1073742087 = EK_MEDIASELECT
493 | getKey 1073742088 = EK_WWW
494 | getKey 1073742089 = EK_MAIL
495 | getKey 1073742090 = EK_CALCULATOR
496 | getKey 1073742091 = EK_COMPUTER
497 | getKey 1073742092 = EK_AC_SEARCH
498 | getKey 1073742093 = EK_AC_HOME
499 | getKey 1073742094 = EK_AC_BACK
500 | getKey 1073742095 = EK_AC_FORWARD
501 | getKey 1073742096 = EK_AC_STOP
502 | getKey 1073742097 = EK_AC_REFRESH
503 | getKey 1073742098 = EK_AC_BOOKMARKS
504 |
505 | getKey 1073742099 = EK_BRIGHTNESSDOWN
506 | getKey 1073742100 = EK_BRIGHTNESSUP
507 | getKey 1073742101 = EK_DISPLAYSWITCH
508 | getKey 1073742102 = EK_KBDILLUMTOGGLE
509 | getKey 1073742103 = EK_KBDILLUMDOWN
510 | getKey 1073742104 = EK_KBDILLUMUP
511 | getKey 1073742105 = EK_EJECT
512 | getKey 1073742106 = EK_SLEEP
513 | getKey 1073742107 = EK_APP1
514 | getKey 1073742108 = EK_APP2
515 |
516 | getKey 1073742109 = EK_AUDIOREWIND
517 | getKey 1073742110 = EK_AUDIOFASTFORWARD
518 |
519 | getKey _            = EK_UNKNOWN