Add color type.
[guile-sdl2.git] / sdl2 / bindings.scm
1 ;;; guile-sdl2 --- FFI bindings for SDL2
2 ;;; Copyright © 2015 David Thompson <davet@gnu.org>
3 ;;;
4 ;;; This file is part of guile-sdl2.
5 ;;;
6 ;;; Guile-sdl2 is free software; you can redistribute it and/or modify
7 ;;; it under the terms of the GNU Lesser General Public License as
8 ;;; published by the Free Software Foundation; either version 3 of the
9 ;;; License, or (at your option) any later version.
10 ;;;
11 ;;; Guile-sdl2 is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 ;;; General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU Lesser General Public
17 ;;; License along with guile-sdl2. If not, see
18 ;;; <http://www.gnu.org/licenses/>.
19
20 ;;; Commentary:
21 ;;
22 ;; Low-level FFI bindings.
23 ;;
24 ;;; Code:
25
26 (define-module (sdl2 bindings)
27 #:use-module (system foreign)
28 #:use-module (sdl2 config)
29 #:export (boolean->sdl-bool
30
31 SDL_INIT_TIMER
32 SDL_INIT_AUDIO
33 SDL_INIT_VIDEO
34 SDL_INIT_HAPTIC
35 SDL_INIT_GAMECONTROLLER
36 SDL_INIT_EVENTS
37 SDL_INIT_NOPARACHUTE
38
39 SDL_WINDOW_FULLSCREEN
40 SDL_WINDOW_OPENGL
41 SDL_WINDOW_SHOWN
42 SDL_WINDOW_HIDDEN
43 SDL_WINDOW_BORDERLESS
44 SDL_WINDOW_RESIZABLE
45 SDL_WINDOW_MINIMIZED
46 SDL_WINDOW_MAXIMIZED
47 SDL_WINDOW_INPUT_GRABBED
48 SDL_WINDOW_INPUT_FOCUS
49 SDL_WINDOW_MOUSE_FOCUS
50 SDL_WINDOW_FULLSCREEN_DESKTOP
51 SDL_WINDOW_FOREIGN
52 SDL_WINDOW_ALLOW_HIGHDPI
53 SDL_WINDOW_MOUSE_CAPTURE
54
55 SDL_RENDERER_SOFTWARE
56 SDL_RENDERER_ACCELERATED
57 SDL_RENDERER_PRESENTVSYNC
58 SDL_RENDERER_TARGETTEXTURE))
59
60 (define sdl-func
61 (let ((lib (dynamic-link %libsdl2)))
62 (lambda (return-type function-name arg-types)
63 "Return a procedure for the foreign function FUNCTION-NAME in
64 the SDL2 shared library. That function must return a value of
65 RETURN-TYPE and accept arguments of ARG-TYPES."
66 (pointer->procedure return-type
67 (dynamic-func function-name lib)
68 arg-types))))
69
70 (define-syntax-rule (define-foreign name return-type func-name arg-types)
71 (define-public name
72 (sdl-func return-type func-name arg-types)))
73
74 \f
75 ;;;
76 ;;; Foreign Types
77 ;;;
78
79 (define-public sdl-color
80 (list uint8 uint8 uint8 uint8))
81
82 (define sdl-bool int)
83
84 (define (boolean->sdl-bool b)
85 "Convert the boolean B to an SDL_bool."
86 (if b 1 0))
87
88 \f
89 ;;;
90 ;;; Errors
91 ;;;
92
93 (define-foreign sdl-get-error
94 '* "SDL_GetError" '())
95
96 \f
97 ;;;
98 ;;; Initialization
99 ;;;
100
101 (define SDL_INIT_TIMER #x00000001)
102 (define SDL_INIT_AUDIO #x00000010)
103 (define SDL_INIT_VIDEO #x00000020)
104 (define SDL_INIT_HAPTIC #x00001000)
105 (define SDL_INIT_GAMECONTROLLER #x00002000)
106 (define SDL_INIT_EVENTS #x00004000)
107
108 (define-foreign sdl-init
109 int "SDL_Init" (list uint32))
110
111 (define-foreign sdl-quit
112 void "SDL_Quit" '())
113
114 \f
115 ;;;
116 ;;; Version
117 ;;;
118
119 (define-foreign sdl-get-version
120 void "SDL_GetVersion" '(*))
121
122 \f
123 ;;;
124 ;;; Video
125 ;;;
126
127 (define SDL_WINDOW_FULLSCREEN #x00000001)
128 (define SDL_WINDOW_OPENGL #x00000002)
129 (define SDL_WINDOW_SHOWN #x00000004)
130 (define SDL_WINDOW_HIDDEN #x00000008)
131 (define SDL_WINDOW_BORDERLESS #x00000010)
132 (define SDL_WINDOW_RESIZABLE #x00000020)
133 (define SDL_WINDOW_MINIMIZED #x00000040)
134 (define SDL_WINDOW_MAXIMIZED #x00000080)
135 (define SDL_WINDOW_INPUT_GRABBED #x00000100)
136 (define SDL_WINDOW_INPUT_FOCUS #x00000200)
137 (define SDL_WINDOW_MOUSE_FOCUS #x00000400)
138 (define SDL_WINDOW_FULLSCREEN_DESKTOP (logior SDL_WINDOW_FULLSCREEN
139 #x00001000))
140 (define SDL_WINDOW_FOREIGN #x00000800)
141 (define SDL_WINDOW_ALLOW_HIGHDPI #x00002000)
142 (define SDL_WINDOW_MOUSE_CAPTURE #x00004000)
143
144 (define-foreign sdl-create-window
145 '* "SDL_CreateWindow" (list '* int int int int uint32))
146
147 (define-foreign sdl-destroy-window
148 void "SDL_DestroyWindow" '(*))
149
150 (define-foreign sdl-get-window-title
151 '* "SDL_GetWindowTitle" '(*))
152
153 (define-foreign sdl-get-window-size
154 void "SDL_GetWindowSize" '(* * *))
155
156 (define-foreign sdl-get-window-position
157 void "SDL_GetWindowPosition" '(* * *))
158
159 (define-foreign sdl-get-window-id
160 uint32 "SDL_GetWindowID" '(*))
161
162 (define-foreign sdl-get-window-from-id
163 '* "SDL_GetWindowFromID" (list uint32))
164
165 (define-foreign sdl-hide-window
166 void "SDL_HideWindow" '(*))
167
168 (define-foreign sdl-show-window
169 void "SDL_ShowWindow" '(*))
170
171 (define-foreign sdl-maximize-window
172 void "SDL_MaximizeWindow" '(*))
173
174 (define-foreign sdl-minimize-window
175 void "SDL_MinimizeWindow" '(*))
176
177 (define-foreign sdl-raise-window
178 void "SDL_RaiseWindow" '(*))
179
180 (define-foreign sdl-restore-window
181 void "SDL_RestoreWindow" '(*))
182
183 (define-foreign sdl-set-window-bordered
184 void "SDL_SetWindowBordered" (list '* sdl-bool))
185
186 (define-foreign sdl-set-window-title
187 void "SDL_SetWindowTitle" '(* *))
188
189 (define-foreign sdl-set-window-position
190 void "SDL_SetWindowPosition" (list '* int int))
191
192 (define-foreign sdl-set-window-size
193 void "SDL_SetWindowSize" (list '* int int))
194
195 (define-foreign sdl-gl-create-context
196 '* "SDL_GL_CreateContext" '(*))
197
198 (define-foreign sdl-gl-delete-context
199 void "SDL_GL_DeleteContext" '(*))
200
201 (define-foreign sdl-gl-swap-window
202 void "SDL_GL_SwapWindow" '(*))
203
204 (define SDL_RENDERER_SOFTWARE #x00000001)
205 (define SDL_RENDERER_ACCELERATED #x00000002)
206 (define SDL_RENDERER_PRESENTVSYNC #x00000004)
207 (define SDL_RENDERER_TARGETTEXTURE #x00000008)
208
209 (define-foreign sdl-create-renderer
210 '* "SDL_CreateRenderer" (list '* int uint32))
211
212 (define-foreign sdl-destroy-renderer
213 void "SDL_DestroyRenderer" '(*))
214
215 (define-foreign sdl-render-clear
216 int "SDL_RenderClear" '(*))
217
218 (define-foreign sdl-render-present
219 void "SDL_RenderPresent" '(*))
220
221 (define-foreign sdl-render-copy
222 int "SDL_RenderCopy" '(* * * *))
223
224 (define-foreign sdl-create-texture-from-surface
225 '* "SDL_CreateTextureFromSurface" '(* *))
226
227 \f
228 ;;;
229 ;;; Events
230 ;;;
231
232 (define-public SDL_QUIT #x100)
233 (define-public SDL_APP_TERMINATING #x101)
234 (define-public SDL_APP_LOWMEMORY #x102)
235 (define-public SDL_APP_WILLENTERBACKGROUND #x103)
236 (define-public SDL_APP_DIDENTERBACKGROUND #x104)
237 (define-public SDL_APP_WILLENTERFOREGROUND #x105)
238 (define-public SDL_APP_DIDENTERFOREGROUND #x106)
239 (define-public SDL_WINDOWEVENT #x200)
240 (define-public SDL_SYSWMEVENT #x201)
241 (define-public SDL_KEYDOWN #x300)
242 (define-public SDL_KEYUP #x301)
243 (define-public SDL_TEXTEDITING #x302)
244 (define-public SDL_TEXTINPUT #x303)
245 (define-public SDL_MOUSEMOTION #x400)
246 (define-public SDL_MOUSEBUTTONDOWN #x401)
247 (define-public SDL_MOUSEBUTTONUP #x402)
248 (define-public SDL_MOUSEWHEEL #x403)
249 (define-public SDL_JOYAXISMOTION #x600)
250 (define-public SDL_JOYBALLMOTION #x601)
251 (define-public SDL_JOYHATMOTION #x602)
252 (define-public SDL_JOYBUTTONDOWN #x603)
253 (define-public SDL_JOYBUTTONUP #x604)
254 (define-public SDL_JOYDEVICEADDED #x605)
255 (define-public SDL_JOYDEVICEREMOVED #x606)
256 (define-public SDL_CONTROLLERAXISMOTION #x650)
257 (define-public SDL_CONTROLLERBUTTONDOWN #x651)
258 (define-public SDL_CONTROLLERBUTTONUP #x652)
259 (define-public SDL_CONTROLLERDEVICEADDED #x653)
260 (define-public SDL_CONTROLLERDEVICEREMOVED #x654)
261 (define-public SDL_CONTROLLERDEVICEREMAPPED #x655)
262 (define-public SDL_FINGERDOWN #x700)
263 (define-public SDL_FINGERUP #x701)
264 (define-public SDL_FINGERMOTION #x702)
265 (define-public SDL_DOLLARGESTURE #x800)
266 (define-public SDL_DOLLARRECORD #x801)
267 (define-public SDL_MULTIGESTURE #x802)
268 (define-public SDL_CLIPBOARDUPDATE #x900)
269 (define-public SDL_DROPFILE #x1000)
270 (define-public SDL_RENDER_TARGETS_RESET #x2000)
271 (define-public SDL_USEREVENT #x8000)
272
273 (define-public SDL_RELEASED 0)
274 (define-public SDL_PRESSED 1)
275
276 (define-public SDL_WINDOWEVENT_NONE 0)
277 (define-public SDL_WINDOWEVENT_SHOWN 1)
278 (define-public SDL_WINDOWEVENT_HIDDEN 2)
279 (define-public SDL_WINDOWEVENT_EXPOSED 3)
280 (define-public SDL_WINDOWEVENT_MOVED 4)
281 (define-public SDL_WINDOWEVENT_RESIZED 5)
282 (define-public SDL_WINDOWEVENT_SIZE_CHANGED 6)
283 (define-public SDL_WINDOWEVENT_MINIMIZED 7)
284 (define-public SDL_WINDOWEVENT_MAXIMIZED 8)
285 (define-public SDL_WINDOWEVENT_RESTORED 9)
286 (define-public SDL_WINDOWEVENT_ENTER 10)
287 (define-public SDL_WINDOWEVENT_LEAVE 11)
288 (define-public SDL_WINDOWEVENT_FOCUS_GAINED 12)
289 (define-public SDL_WINDOWEVENT_FOCUS_LOST 13)
290 (define-public SDL_WINDOWEVENT_CLOSE 14)
291
292 (define-foreign sdl-poll-event
293 int "SDL_PollEvent" '(*))
294
295 \f
296 ;;;
297 ;;; Keycodes and scancodes
298 ;;;
299
300 (define-public KMOD_NONE #x0000)
301 (define-public KMOD_LSHIFT #x0001)
302 (define-public KMOD_RSHIFT #x0002)
303 (define-public KMOD_LCTRL #x0040)
304 (define-public KMOD_RCTRL #x0080)
305 (define-public KMOD_LALT #x0100)
306 (define-public KMOD_RALT #x0200)
307 (define-public KMOD_LGUI #x0400)
308 (define-public KMOD_RGUI #x0800)
309 (define-public KMOD_NUM #x1000)
310 (define-public KMOD_CAPS #x2000)
311 (define-public KMOD_MODE #x4000)
312
313 (define-public SDLK_SCANCODE_MASK (ash 1 30))
314
315 (define-public (scancode->keycode scancode)
316 (logior scancode SDLK_SCANCODE_MASK))
317
318 (define-public SDL_SCANCODE_UNKNOWN 0)
319 (define-public SDL_SCANCODE_A 4)
320 (define-public SDL_SCANCODE_B 5)
321 (define-public SDL_SCANCODE_C 6)
322 (define-public SDL_SCANCODE_D 7)
323 (define-public SDL_SCANCODE_E 8)
324 (define-public SDL_SCANCODE_F 9)
325 (define-public SDL_SCANCODE_G 10)
326 (define-public SDL_SCANCODE_H 11)
327 (define-public SDL_SCANCODE_I 12)
328 (define-public SDL_SCANCODE_J 13)
329 (define-public SDL_SCANCODE_K 14)
330 (define-public SDL_SCANCODE_L 15)
331 (define-public SDL_SCANCODE_M 16)
332 (define-public SDL_SCANCODE_N 17)
333 (define-public SDL_SCANCODE_O 18)
334 (define-public SDL_SCANCODE_P 19)
335 (define-public SDL_SCANCODE_Q 20)
336 (define-public SDL_SCANCODE_R 21)
337 (define-public SDL_SCANCODE_S 22)
338 (define-public SDL_SCANCODE_T 23)
339 (define-public SDL_SCANCODE_U 24)
340 (define-public SDL_SCANCODE_V 25)
341 (define-public SDL_SCANCODE_W 26)
342 (define-public SDL_SCANCODE_X 27)
343 (define-public SDL_SCANCODE_Y 28)
344 (define-public SDL_SCANCODE_Z 29)
345 (define-public SDL_SCANCODE_1 30)
346 (define-public SDL_SCANCODE_2 31)
347 (define-public SDL_SCANCODE_3 32)
348 (define-public SDL_SCANCODE_4 33)
349 (define-public SDL_SCANCODE_5 34)
350 (define-public SDL_SCANCODE_6 35)
351 (define-public SDL_SCANCODE_7 36)
352 (define-public SDL_SCANCODE_8 37)
353 (define-public SDL_SCANCODE_9 38)
354 (define-public SDL_SCANCODE_0 39)
355 (define-public SDL_SCANCODE_RETURN 40)
356 (define-public SDL_SCANCODE_ESCAPE 41)
357 (define-public SDL_SCANCODE_BACKSPACE 42)
358 (define-public SDL_SCANCODE_TAB 43)
359 (define-public SDL_SCANCODE_SPACE 44)
360 (define-public SDL_SCANCODE_MINUS 45)
361 (define-public SDL_SCANCODE_EQUALS 46)
362 (define-public SDL_SCANCODE_LEFTBRACKET 47)
363 (define-public SDL_SCANCODE_RIGHTBRACKET 48)
364 (define-public SDL_SCANCODE_BACKSLASH 49)
365 (define-public SDL_SCANCODE_NONUSHASH 50)
366 (define-public SDL_SCANCODE_SEMICOLON 51)
367 (define-public SDL_SCANCODE_APOSTROPHE 52)
368 (define-public SDL_SCANCODE_GRAVE 53)
369 (define-public SDL_SCANCODE_COMMA 54)
370 (define-public SDL_SCANCODE_PERIOD 55)
371 (define-public SDL_SCANCODE_SLASH 56)
372 (define-public SDL_SCANCODE_CAPSLOCK 57)
373 (define-public SDL_SCANCODE_F1 58)
374 (define-public SDL_SCANCODE_F2 59)
375 (define-public SDL_SCANCODE_F3 60)
376 (define-public SDL_SCANCODE_F4 61)
377 (define-public SDL_SCANCODE_F5 62)
378 (define-public SDL_SCANCODE_F6 63)
379 (define-public SDL_SCANCODE_F7 64)
380 (define-public SDL_SCANCODE_F8 65)
381 (define-public SDL_SCANCODE_F9 66)
382 (define-public SDL_SCANCODE_F10 67)
383 (define-public SDL_SCANCODE_F11 68)
384 (define-public SDL_SCANCODE_F12 69)
385 (define-public SDL_SCANCODE_PRINTSCREEN 70)
386 (define-public SDL_SCANCODE_SCROLLLOCK 71)
387 (define-public SDL_SCANCODE_PAUSE 72)
388 (define-public SDL_SCANCODE_INSERT 73)
389 (define-public SDL_SCANCODE_HOME 74)
390 (define-public SDL_SCANCODE_PAGEUP 75)
391 (define-public SDL_SCANCODE_DELETE 76)
392 (define-public SDL_SCANCODE_END 77)
393 (define-public SDL_SCANCODE_PAGEDOWN 78)
394 (define-public SDL_SCANCODE_RIGHT 79)
395 (define-public SDL_SCANCODE_LEFT 80)
396 (define-public SDL_SCANCODE_DOWN 81)
397 (define-public SDL_SCANCODE_UP 82)
398 (define-public SDL_SCANCODE_NUMLOCKCLEAR 83)
399 (define-public SDL_SCANCODE_KP_DIVIDE 84)
400 (define-public SDL_SCANCODE_KP_MULTIPLY 85)
401 (define-public SDL_SCANCODE_KP_MINUS 86)
402 (define-public SDL_SCANCODE_KP_PLUS 87)
403 (define-public SDL_SCANCODE_KP_ENTER 88)
404 (define-public SDL_SCANCODE_KP_1 89)
405 (define-public SDL_SCANCODE_KP_2 90)
406 (define-public SDL_SCANCODE_KP_3 91)
407 (define-public SDL_SCANCODE_KP_4 92)
408 (define-public SDL_SCANCODE_KP_5 93)
409 (define-public SDL_SCANCODE_KP_6 94)
410 (define-public SDL_SCANCODE_KP_7 95)
411 (define-public SDL_SCANCODE_KP_8 96)
412 (define-public SDL_SCANCODE_KP_9 97)
413 (define-public SDL_SCANCODE_KP_0 98)
414 (define-public SDL_SCANCODE_KP_PERIOD 99)
415 (define-public SDL_SCANCODE_NONUSBACKSLASH 100)
416 (define-public SDL_SCANCODE_APPLICATION 101)
417 (define-public SDL_SCANCODE_POWER 102)
418 (define-public SDL_SCANCODE_KP_EQUALS 103)
419 (define-public SDL_SCANCODE_F13 104)
420 (define-public SDL_SCANCODE_F14 105)
421 (define-public SDL_SCANCODE_F15 106)
422 (define-public SDL_SCANCODE_F16 107)
423 (define-public SDL_SCANCODE_F17 108)
424 (define-public SDL_SCANCODE_F18 109)
425 (define-public SDL_SCANCODE_F19 110)
426 (define-public SDL_SCANCODE_F20 111)
427 (define-public SDL_SCANCODE_F21 112)
428 (define-public SDL_SCANCODE_F22 113)
429 (define-public SDL_SCANCODE_F23 114)
430 (define-public SDL_SCANCODE_F24 115)
431 (define-public SDL_SCANCODE_EXECUTE 116)
432 (define-public SDL_SCANCODE_HELP 117)
433 (define-public SDL_SCANCODE_MENU 118)
434 (define-public SDL_SCANCODE_SELECT 119)
435 (define-public SDL_SCANCODE_STOP 120)
436 (define-public SDL_SCANCODE_AGAIN 121)
437 (define-public SDL_SCANCODE_UNDO 122)
438 (define-public SDL_SCANCODE_CUT 123)
439 (define-public SDL_SCANCODE_COPY 124)
440 (define-public SDL_SCANCODE_PASTE 125)
441 (define-public SDL_SCANCODE_FIND 126)
442 (define-public SDL_SCANCODE_MUTE 127)
443 (define-public SDL_SCANCODE_VOLUMEUP 128)
444 (define-public SDL_SCANCODE_VOLUMEDOWN 129)
445 (define-public SDL_SCANCODE_KP_COMMA 133)
446 (define-public SDL_SCANCODE_KP_EQUALSAS400 134)
447 (define-public SDL_SCANCODE_INTERNATIONAL1 135)
448 (define-public SDL_SCANCODE_INTERNATIONAL2 136)
449 (define-public SDL_SCANCODE_INTERNATIONAL3 137)
450 (define-public SDL_SCANCODE_INTERNATIONAL4 138)
451 (define-public SDL_SCANCODE_INTERNATIONAL5 139)
452 (define-public SDL_SCANCODE_INTERNATIONAL6 140)
453 (define-public SDL_SCANCODE_INTERNATIONAL7 141)
454 (define-public SDL_SCANCODE_INTERNATIONAL8 142)
455 (define-public SDL_SCANCODE_INTERNATIONAL9 143)
456 (define-public SDL_SCANCODE_LANG1 144)
457 (define-public SDL_SCANCODE_LANG2 145)
458 (define-public SDL_SCANCODE_LANG3 146)
459 (define-public SDL_SCANCODE_LANG4 147)
460 (define-public SDL_SCANCODE_LANG5 148)
461 (define-public SDL_SCANCODE_LANG6 149)
462 (define-public SDL_SCANCODE_LANG7 150)
463 (define-public SDL_SCANCODE_LANG8 151)
464 (define-public SDL_SCANCODE_LANG9 152)
465 (define-public SDL_SCANCODE_ALTERASE 153)
466 (define-public SDL_SCANCODE_SYSREQ 154)
467 (define-public SDL_SCANCODE_CANCEL 155)
468 (define-public SDL_SCANCODE_CLEAR 156)
469 (define-public SDL_SCANCODE_PRIOR 157)
470 (define-public SDL_SCANCODE_RETURN2 158)
471 (define-public SDL_SCANCODE_SEPARATOR 159)
472 (define-public SDL_SCANCODE_OUT 160)
473 (define-public SDL_SCANCODE_OPER 161)
474 (define-public SDL_SCANCODE_CLEARAGAIN 162)
475 (define-public SDL_SCANCODE_CRSEL 163)
476 (define-public SDL_SCANCODE_EXSEL 164)
477 (define-public SDL_SCANCODE_KP_00 176)
478 (define-public SDL_SCANCODE_KP_000 177)
479 (define-public SDL_SCANCODE_THOUSANDSSEPARATOR 178)
480 (define-public SDL_SCANCODE_DECIMALSEPARATOR 179)
481 (define-public SDL_SCANCODE_CURRENCYUNIT 180)
482 (define-public SDL_SCANCODE_CURRENCYSUBUNIT 181)
483 (define-public SDL_SCANCODE_KP_LEFTPAREN 182)
484 (define-public SDL_SCANCODE_KP_RIGHTPAREN 183)
485 (define-public SDL_SCANCODE_KP_LEFTBRACE 184)
486 (define-public SDL_SCANCODE_KP_RIGHTBRACE 185)
487 (define-public SDL_SCANCODE_KP_TAB 186)
488 (define-public SDL_SCANCODE_KP_BACKSPACE 187)
489 (define-public SDL_SCANCODE_KP_A 188)
490 (define-public SDL_SCANCODE_KP_B 189)
491 (define-public SDL_SCANCODE_KP_C 190)
492 (define-public SDL_SCANCODE_KP_D 191)
493 (define-public SDL_SCANCODE_KP_E 192)
494 (define-public SDL_SCANCODE_KP_F 193)
495 (define-public SDL_SCANCODE_KP_XOR 194)
496 (define-public SDL_SCANCODE_KP_POWER 195)
497 (define-public SDL_SCANCODE_KP_PERCENT 196)
498 (define-public SDL_SCANCODE_KP_LESS 197)
499 (define-public SDL_SCANCODE_KP_GREATER 198)
500 (define-public SDL_SCANCODE_KP_AMPERSAND 199)
501 (define-public SDL_SCANCODE_KP_DBLAMPERSAND 200)
502 (define-public SDL_SCANCODE_KP_VERTICALBAR 201)
503 (define-public SDL_SCANCODE_KP_DBLVERTICALBAR 202)
504 (define-public SDL_SCANCODE_KP_COLON 203)
505 (define-public SDL_SCANCODE_KP_HASH 204)
506 (define-public SDL_SCANCODE_KP_SPACE 205)
507 (define-public SDL_SCANCODE_KP_AT 206)
508 (define-public SDL_SCANCODE_KP_EXCLAM 207)
509 (define-public SDL_SCANCODE_KP_MEMSTORE 208)
510 (define-public SDL_SCANCODE_KP_MEMRECALL 209)
511 (define-public SDL_SCANCODE_KP_MEMCLEAR 210)
512 (define-public SDL_SCANCODE_KP_MEMADD 211)
513 (define-public SDL_SCANCODE_KP_MEMSUBTRACT 212)
514 (define-public SDL_SCANCODE_KP_MEMMULTIPLY 213)
515 (define-public SDL_SCANCODE_KP_MEMDIVIDE 214)
516 (define-public SDL_SCANCODE_KP_PLUSMINUS 215)
517 (define-public SDL_SCANCODE_KP_CLEAR 216)
518 (define-public SDL_SCANCODE_KP_CLEARENTRY 217)
519 (define-public SDL_SCANCODE_KP_BINARY 218)
520 (define-public SDL_SCANCODE_KP_OCTAL 219)
521 (define-public SDL_SCANCODE_KP_DECIMAL 220)
522 (define-public SDL_SCANCODE_KP_HEXADECIMAL 221)
523 (define-public SDL_SCANCODE_LCTRL 224)
524 (define-public SDL_SCANCODE_LSHIFT 225)
525 (define-public SDL_SCANCODE_LALT 226)
526 (define-public SDL_SCANCODE_LGUI 227)
527 (define-public SDL_SCANCODE_RCTRL 228)
528 (define-public SDL_SCANCODE_RSHIFT 229)
529 (define-public SDL_SCANCODE_RALT 230)
530 (define-public SDL_SCANCODE_RGUI 231)
531 (define-public SDL_SCANCODE_MODE 257)
532 (define-public SDL_SCANCODE_AUDIONEXT 258)
533 (define-public SDL_SCANCODE_AUDIOPREV 259)
534 (define-public SDL_SCANCODE_AUDIOSTOP 260)
535 (define-public SDL_SCANCODE_AUDIOPLAY 261)
536 (define-public SDL_SCANCODE_AUDIOMUTE 262)
537 (define-public SDL_SCANCODE_MEDIASELECT 263)
538 (define-public SDL_SCANCODE_WWW 264)
539 (define-public SDL_SCANCODE_MAIL 265)
540 (define-public SDL_SCANCODE_CALCULATOR 266)
541 (define-public SDL_SCANCODE_COMPUTER 267)
542 (define-public SDL_SCANCODE_AC_SEARCH 268)
543 (define-public SDL_SCANCODE_AC_HOME 269)
544 (define-public SDL_SCANCODE_AC_BACK 270)
545 (define-public SDL_SCANCODE_AC_FORWARD 271)
546 (define-public SDL_SCANCODE_AC_STOP 272)
547 (define-public SDL_SCANCODE_AC_REFRESH 273)
548 (define-public SDL_SCANCODE_AC_BOOKMARKS 274)
549 (define-public SDL_SCANCODE_BRIGHTNESSDOWN 275)
550 (define-public SDL_SCANCODE_BRIGHTNESSUP 276)
551 (define-public SDL_SCANCODE_DISPLAYSWITCH 277)
552 (define-public SDL_SCANCODE_KBDILLUMTOGGLE 278)
553 (define-public SDL_SCANCODE_KBDILLUMDOWN 279)
554 (define-public SDL_SCANCODE_KBDILLUMUP 280)
555 (define-public SDL_SCANCODE_EJECT 281)
556 (define-public SDL_SCANCODE_SLEEP 282)
557 (define-public SDL_SCANCODE_APP1 283)
558 (define-public SDL_SCANCODE_APP2 284)
559 (define-public SDL_NUM_SCANCODES 512)
560
561 (define-public SDLK_UNKNOWN 0)
562 (define-public SDLK_RETURN 13)
563 (define-public SDLK_ESCAPE 27)
564 (define-public SDLK_BACKSPACE 8)
565 (define-public SDLK_TAB 9)
566 (define-public SDLK_SPACE 32)
567 (define-public SDLK_EXCLAIM 33)
568 (define-public SDLK_QUOTEDBL 34)
569 (define-public SDLK_HASH 35)
570 (define-public SDLK_PERCENT 37)
571 (define-public SDLK_DOLLAR 36)
572 (define-public SDLK_AMPERSAND 38)
573 (define-public SDLK_QUOTE 39)
574 (define-public SDLK_LEFTPAREN 40)
575 (define-public SDLK_RIGHTPAREN 41)
576 (define-public SDLK_ASTERISK 42)
577 (define-public SDLK_PLUS 43)
578 (define-public SDLK_COMMA 44)
579 (define-public SDLK_MINUS 45)
580 (define-public SDLK_PERIOD 46)
581 (define-public SDLK_SLASH 47)
582 (define-public SDLK_0 48)
583 (define-public SDLK_1 49)
584 (define-public SDLK_2 50)
585 (define-public SDLK_3 51)
586 (define-public SDLK_4 52)
587 (define-public SDLK_5 53)
588 (define-public SDLK_6 54)
589 (define-public SDLK_7 55)
590 (define-public SDLK_8 56)
591 (define-public SDLK_9 57)
592 (define-public SDLK_COLON 58)
593 (define-public SDLK_SEMICOLON 59)
594 (define-public SDLK_LESS 60)
595 (define-public SDLK_EQUALS 61)
596 (define-public SDLK_GREATER 62)
597 (define-public SDLK_QUESTION 63)
598 (define-public SDLK_AT 64)
599 (define-public SDLK_LEFTBRACKET 91)
600 (define-public SDLK_BACKSLASH 92)
601 (define-public SDLK_RIGHTBRACKET 93)
602 (define-public SDLK_CARET 94)
603 (define-public SDLK_UNDERSCORE 95)
604 (define-public SDLK_BACKQUOTE 96)
605 (define-public SDLK_a 97)
606 (define-public SDLK_b 98)
607 (define-public SDLK_c 99)
608 (define-public SDLK_d 100)
609 (define-public SDLK_e 101)
610 (define-public SDLK_f 102)
611 (define-public SDLK_g 103)
612 (define-public SDLK_h 104)
613 (define-public SDLK_i 105)
614 (define-public SDLK_j 106)
615 (define-public SDLK_k 107)
616 (define-public SDLK_l 108)
617 (define-public SDLK_m 109)
618 (define-public SDLK_n 110)
619 (define-public SDLK_o 111)
620 (define-public SDLK_p 112)
621 (define-public SDLK_q 113)
622 (define-public SDLK_r 114)
623 (define-public SDLK_s 115)
624 (define-public SDLK_t 116)
625 (define-public SDLK_u 117)
626 (define-public SDLK_v 118)
627 (define-public SDLK_w 119)
628 (define-public SDLK_x 120)
629 (define-public SDLK_y 121)
630 (define-public SDLK_z 122)
631 (define-public SDLK_CAPSLOCK (scancode->keycode SDL_SCANCODE_CAPSLOCK))
632 (define-public SDLK_F1 (scancode->keycode SDL_SCANCODE_F1))
633 (define-public SDLK_F2 (scancode->keycode SDL_SCANCODE_F2))
634 (define-public SDLK_F3 (scancode->keycode SDL_SCANCODE_F3))
635 (define-public SDLK_F4 (scancode->keycode SDL_SCANCODE_F4))
636 (define-public SDLK_F5 (scancode->keycode SDL_SCANCODE_F5))
637 (define-public SDLK_F6 (scancode->keycode SDL_SCANCODE_F6))
638 (define-public SDLK_F7 (scancode->keycode SDL_SCANCODE_F7))
639 (define-public SDLK_F8 (scancode->keycode SDL_SCANCODE_F8))
640 (define-public SDLK_F9 (scancode->keycode SDL_SCANCODE_F9))
641 (define-public SDLK_F10 (scancode->keycode SDL_SCANCODE_F10))
642 (define-public SDLK_F11 (scancode->keycode SDL_SCANCODE_F11))
643 (define-public SDLK_F12 (scancode->keycode SDL_SCANCODE_F12))
644 (define-public SDLK_PRINTSCREEN (scancode->keycode SDL_SCANCODE_PRINTSCREEN))
645 (define-public SDLK_SCROLLLOCK (scancode->keycode SDL_SCANCODE_SCROLLLOCK))
646 (define-public SDLK_PAUSE (scancode->keycode SDL_SCANCODE_PAUSE))
647 (define-public SDLK_INSERT (scancode->keycode SDL_SCANCODE_INSERT))
648 (define-public SDLK_HOME (scancode->keycode SDL_SCANCODE_HOME))
649 (define-public SDLK_PAGEUP (scancode->keycode SDL_SCANCODE_PAGEUP))
650 (define-public SDLK_DELETE 127)
651 (define-public SDLK_END (scancode->keycode SDL_SCANCODE_END))
652 (define-public SDLK_PAGEDOWN (scancode->keycode SDL_SCANCODE_PAGEDOWN))
653 (define-public SDLK_RIGHT (scancode->keycode SDL_SCANCODE_RIGHT))
654 (define-public SDLK_LEFT (scancode->keycode SDL_SCANCODE_LEFT))
655 (define-public SDLK_DOWN (scancode->keycode SDL_SCANCODE_DOWN))
656 (define-public SDLK_UP (scancode->keycode SDL_SCANCODE_UP))
657 (define-public SDLK_NUMLOCKCLEAR (scancode->keycode SDL_SCANCODE_NUMLOCKCLEAR))
658 (define-public SDLK_KP_DIVIDE (scancode->keycode SDL_SCANCODE_KP_DIVIDE))
659 (define-public SDLK_KP_MULTIPLY (scancode->keycode SDL_SCANCODE_KP_MULTIPLY))
660 (define-public SDLK_KP_MINUS (scancode->keycode SDL_SCANCODE_KP_MINUS))
661 (define-public SDLK_KP_PLUS (scancode->keycode SDL_SCANCODE_KP_PLUS))
662 (define-public SDLK_KP_ENTER (scancode->keycode SDL_SCANCODE_KP_ENTER))
663 (define-public SDLK_KP_1 (scancode->keycode SDL_SCANCODE_KP_1))
664 (define-public SDLK_KP_2 (scancode->keycode SDL_SCANCODE_KP_2))
665 (define-public SDLK_KP_3 (scancode->keycode SDL_SCANCODE_KP_3))
666 (define-public SDLK_KP_4 (scancode->keycode SDL_SCANCODE_KP_4))
667 (define-public SDLK_KP_5 (scancode->keycode SDL_SCANCODE_KP_5))
668 (define-public SDLK_KP_6 (scancode->keycode SDL_SCANCODE_KP_6))
669 (define-public SDLK_KP_7 (scancode->keycode SDL_SCANCODE_KP_7))
670 (define-public SDLK_KP_8 (scancode->keycode SDL_SCANCODE_KP_8))
671 (define-public SDLK_KP_9 (scancode->keycode SDL_SCANCODE_KP_9))
672 (define-public SDLK_KP_0 (scancode->keycode SDL_SCANCODE_KP_0))
673 (define-public SDLK_KP_PERIOD (scancode->keycode SDL_SCANCODE_KP_PERIOD))
674 (define-public SDLK_APPLICATION (scancode->keycode SDL_SCANCODE_APPLICATION))
675 (define-public SDLK_POWER (scancode->keycode SDL_SCANCODE_POWER))
676 (define-public SDLK_KP_EQUALS (scancode->keycode SDL_SCANCODE_KP_EQUALS))
677 (define-public SDLK_F13 (scancode->keycode SDL_SCANCODE_F13))
678 (define-public SDLK_F14 (scancode->keycode SDL_SCANCODE_F14))
679 (define-public SDLK_F15 (scancode->keycode SDL_SCANCODE_F15))
680 (define-public SDLK_F16 (scancode->keycode SDL_SCANCODE_F16))
681 (define-public SDLK_F17 (scancode->keycode SDL_SCANCODE_F17))
682 (define-public SDLK_F18 (scancode->keycode SDL_SCANCODE_F18))
683 (define-public SDLK_F19 (scancode->keycode SDL_SCANCODE_F19))
684 (define-public SDLK_F20 (scancode->keycode SDL_SCANCODE_F20))
685 (define-public SDLK_F21 (scancode->keycode SDL_SCANCODE_F21))
686 (define-public SDLK_F22 (scancode->keycode SDL_SCANCODE_F22))
687 (define-public SDLK_F23 (scancode->keycode SDL_SCANCODE_F23))
688 (define-public SDLK_F24 (scancode->keycode SDL_SCANCODE_F24))
689 (define-public SDLK_EXECUTE (scancode->keycode SDL_SCANCODE_EXECUTE))
690 (define-public SDLK_HELP (scancode->keycode SDL_SCANCODE_HELP))
691 (define-public SDLK_MENU (scancode->keycode SDL_SCANCODE_MENU))
692 (define-public SDLK_SELECT (scancode->keycode SDL_SCANCODE_SELECT))
693 (define-public SDLK_STOP (scancode->keycode SDL_SCANCODE_STOP))
694 (define-public SDLK_AGAIN (scancode->keycode SDL_SCANCODE_AGAIN))
695 (define-public SDLK_UNDO (scancode->keycode SDL_SCANCODE_UNDO))
696 (define-public SDLK_CUT (scancode->keycode SDL_SCANCODE_CUT))
697 (define-public SDLK_COPY (scancode->keycode SDL_SCANCODE_COPY))
698 (define-public SDLK_PASTE (scancode->keycode SDL_SCANCODE_PASTE))
699 (define-public SDLK_FIND (scancode->keycode SDL_SCANCODE_FIND))
700 (define-public SDLK_MUTE (scancode->keycode SDL_SCANCODE_MUTE))
701 (define-public SDLK_VOLUMEUP (scancode->keycode SDL_SCANCODE_VOLUMEUP))
702 (define-public SDLK_VOLUMEDOWN (scancode->keycode SDL_SCANCODE_VOLUMEDOWN))
703 (define-public SDLK_KP_COMMA (scancode->keycode SDL_SCANCODE_KP_COMMA))
704 (define-public SDLK_KP_EQUALSAS400
705 (scancode->keycode SDL_SCANCODE_KP_EQUALSAS400))
706 (define-public SDLK_ALTERASE (scancode->keycode SDL_SCANCODE_ALTERASE))
707 (define-public SDLK_SYSREQ (scancode->keycode SDL_SCANCODE_SYSREQ))
708 (define-public SDLK_CANCEL (scancode->keycode SDL_SCANCODE_CANCEL))
709 (define-public SDLK_CLEAR (scancode->keycode SDL_SCANCODE_CLEAR))
710 (define-public SDLK_PRIOR (scancode->keycode SDL_SCANCODE_PRIOR))
711 (define-public SDLK_RETURN2 (scancode->keycode SDL_SCANCODE_RETURN2))
712 (define-public SDLK_SEPARATOR (scancode->keycode SDL_SCANCODE_SEPARATOR))
713 (define-public SDLK_OUT (scancode->keycode SDL_SCANCODE_OUT))
714 (define-public SDLK_OPER (scancode->keycode SDL_SCANCODE_OPER))
715 (define-public SDLK_CLEARAGAIN (scancode->keycode SDL_SCANCODE_CLEARAGAIN))
716 (define-public SDLK_CRSEL (scancode->keycode SDL_SCANCODE_CRSEL))
717 (define-public SDLK_EXSEL (scancode->keycode SDL_SCANCODE_EXSEL))
718 (define-public SDLK_KP_00 (scancode->keycode SDL_SCANCODE_KP_00))
719 (define-public SDLK_KP_000 (scancode->keycode SDL_SCANCODE_KP_000))
720 (define-public SDLK_THOUSANDSSEPARATOR
721 (scancode->keycode SDL_SCANCODE_THOUSANDSSEPARATOR))
722 (define-public SDLK_DECIMALSEPARATOR
723 (scancode->keycode SDL_SCANCODE_DECIMALSEPARATOR))
724 (define-public SDLK_CURRENCYUNIT (scancode->keycode SDL_SCANCODE_CURRENCYUNIT))
725 (define-public SDLK_CURRENCYSUBUNIT
726 (scancode->keycode SDL_SCANCODE_CURRENCYSUBUNIT))
727 (define-public SDLK_KP_LEFTPAREN (scancode->keycode SDL_SCANCODE_KP_LEFTPAREN))
728 (define-public SDLK_KP_RIGHTPAREN
729 (scancode->keycode SDL_SCANCODE_KP_RIGHTPAREN))
730 (define-public SDLK_KP_LEFTBRACE (scancode->keycode SDL_SCANCODE_KP_LEFTBRACE))
731 (define-public SDLK_KP_RIGHTBRACE (scancode->keycode SDL_SCANCODE_KP_RIGHTBRACE))
732 (define-public SDLK_KP_TAB (scancode->keycode SDL_SCANCODE_KP_TAB))
733 (define-public SDLK_KP_BACKSPACE (scancode->keycode SDL_SCANCODE_KP_BACKSPACE))
734 (define-public SDLK_KP_A (scancode->keycode SDL_SCANCODE_KP_A))
735 (define-public SDLK_KP_B (scancode->keycode SDL_SCANCODE_KP_B))
736 (define-public SDLK_KP_C (scancode->keycode SDL_SCANCODE_KP_C))
737 (define-public SDLK_KP_D (scancode->keycode SDL_SCANCODE_KP_D))
738 (define-public SDLK_KP_E (scancode->keycode SDL_SCANCODE_KP_E))
739 (define-public SDLK_KP_F (scancode->keycode SDL_SCANCODE_KP_F))
740 (define-public SDLK_KP_XOR (scancode->keycode SDL_SCANCODE_KP_XOR))
741 (define-public SDLK_KP_POWER (scancode->keycode SDL_SCANCODE_KP_POWER))
742 (define-public SDLK_KP_PERCENT (scancode->keycode SDL_SCANCODE_KP_PERCENT))
743 (define-public SDLK_KP_LESS (scancode->keycode SDL_SCANCODE_KP_LESS))
744 (define-public SDLK_KP_GREATER (scancode->keycode SDL_SCANCODE_KP_GREATER))
745 (define-public SDLK_KP_AMPERSAND (scancode->keycode SDL_SCANCODE_KP_AMPERSAND))
746 (define-public SDLK_KP_DBLAMPERSAND
747 (scancode->keycode SDL_SCANCODE_KP_DBLAMPERSAND))
748 (define-public SDLK_KP_VERTICALBAR
749 (scancode->keycode SDL_SCANCODE_KP_VERTICALBAR))
750 (define-public SDLK_KP_DBLVERTICALBAR
751 (scancode->keycode SDL_SCANCODE_KP_DBLVERTICALBAR))
752 (define-public SDLK_KP_COLON (scancode->keycode SDL_SCANCODE_KP_COLON))
753 (define-public SDLK_KP_HASH (scancode->keycode SDL_SCANCODE_KP_HASH))
754 (define-public SDLK_KP_SPACE (scancode->keycode SDL_SCANCODE_KP_SPACE))
755 (define-public SDLK_KP_AT (scancode->keycode SDL_SCANCODE_KP_AT))
756 (define-public SDLK_KP_EXCLAM (scancode->keycode SDL_SCANCODE_KP_EXCLAM))
757 (define-public SDLK_KP_MEMSTORE (scancode->keycode SDL_SCANCODE_KP_MEMSTORE))
758 (define-public SDLK_KP_MEMRECALL (scancode->keycode SDL_SCANCODE_KP_MEMRECALL))
759 (define-public SDLK_KP_MEMCLEAR (scancode->keycode SDL_SCANCODE_KP_MEMCLEAR))
760 (define-public SDLK_KP_MEMADD (scancode->keycode SDL_SCANCODE_KP_MEMADD))
761 (define-public SDLK_KP_MEMSUBTRACT
762 (scancode->keycode SDL_SCANCODE_KP_MEMSUBTRACT))
763 (define-public SDLK_KP_MEMMULTIPLY
764 (scancode->keycode SDL_SCANCODE_KP_MEMMULTIPLY))
765 (define-public SDLK_KP_MEMDIVIDE (scancode->keycode SDL_SCANCODE_KP_MEMDIVIDE))
766 (define-public SDLK_KP_PLUSMINUS (scancode->keycode SDL_SCANCODE_KP_PLUSMINUS))
767 (define-public SDLK_KP_CLEAR (scancode->keycode SDL_SCANCODE_KP_CLEAR))
768 (define-public SDLK_KP_CLEARENTRY (scancode->keycode SDL_SCANCODE_KP_CLEARENTRY))
769 (define-public SDLK_KP_BINARY (scancode->keycode SDL_SCANCODE_KP_BINARY))
770 (define-public SDLK_KP_OCTAL (scancode->keycode SDL_SCANCODE_KP_OCTAL))
771 (define-public SDLK_KP_DECIMAL (scancode->keycode SDL_SCANCODE_KP_DECIMAL))
772 (define-public SDLK_KP_HEXADECIMAL
773 (scancode->keycode SDL_SCANCODE_KP_HEXADECIMAL))
774 (define-public SDLK_LCTRL (scancode->keycode SDL_SCANCODE_LCTRL))
775 (define-public SDLK_LSHIFT (scancode->keycode SDL_SCANCODE_LSHIFT))
776 (define-public SDLK_LALT (scancode->keycode SDL_SCANCODE_LALT))
777 (define-public SDLK_LGUI (scancode->keycode SDL_SCANCODE_LGUI))
778 (define-public SDLK_RCTRL (scancode->keycode SDL_SCANCODE_RCTRL))
779 (define-public SDLK_RSHIFT (scancode->keycode SDL_SCANCODE_RSHIFT))
780 (define-public SDLK_RALT (scancode->keycode SDL_SCANCODE_RALT))
781 (define-public SDLK_RGUI (scancode->keycode SDL_SCANCODE_RGUI))
782 (define-public SDLK_MODE (scancode->keycode SDL_SCANCODE_MODE))
783 (define-public SDLK_AUDIONEXT (scancode->keycode SDL_SCANCODE_AUDIONEXT))
784 (define-public SDLK_AUDIOPREV (scancode->keycode SDL_SCANCODE_AUDIOPREV))
785 (define-public SDLK_AUDIOSTOP (scancode->keycode SDL_SCANCODE_AUDIOSTOP))
786 (define-public SDLK_AUDIOPLAY (scancode->keycode SDL_SCANCODE_AUDIOPLAY))
787 (define-public SDLK_AUDIOMUTE (scancode->keycode SDL_SCANCODE_AUDIOMUTE))
788 (define-public SDLK_MEDIASELECT (scancode->keycode SDL_SCANCODE_MEDIASELECT))
789 (define-public SDLK_WWW (scancode->keycode SDL_SCANCODE_WWW))
790 (define-public SDLK_MAIL (scancode->keycode SDL_SCANCODE_MAIL))
791 (define-public SDLK_CALCULATOR (scancode->keycode SDL_SCANCODE_CALCULATOR))
792 (define-public SDLK_COMPUTER (scancode->keycode SDL_SCANCODE_COMPUTER))
793 (define-public SDLK_AC_SEARCH (scancode->keycode SDL_SCANCODE_AC_SEARCH))
794 (define-public SDLK_AC_HOME (scancode->keycode SDL_SCANCODE_AC_HOME))
795 (define-public SDLK_AC_BACK (scancode->keycode SDL_SCANCODE_AC_BACK))
796 (define-public SDLK_AC_FORWARD (scancode->keycode SDL_SCANCODE_AC_FORWARD))
797 (define-public SDLK_AC_STOP (scancode->keycode SDL_SCANCODE_AC_STOP))
798 (define-public SDLK_AC_REFRESH (scancode->keycode SDL_SCANCODE_AC_REFRESH))
799 (define-public SDLK_AC_BOOKMARKS (scancode->keycode SDL_SCANCODE_AC_BOOKMARKS))
800 (define-public SDLK_BRIGHTNESSDOWN
801 (scancode->keycode SDL_SCANCODE_BRIGHTNESSDOWN))
802 (define-public SDLK_BRIGHTNESSUP (scancode->keycode SDL_SCANCODE_BRIGHTNESSUP))
803 (define-public SDLK_DISPLAYSWITCH (scancode->keycode SDL_SCANCODE_DISPLAYSWITCH))
804 (define-public SDLK_KBDILLUMTOGGLE
805 (scancode->keycode SDL_SCANCODE_KBDILLUMTOGGLE))
806 (define-public SDLK_KBDILLUMDOWN (scancode->keycode SDL_SCANCODE_KBDILLUMDOWN))
807 (define-public SDLK_KBDILLUMUP (scancode->keycode SDL_SCANCODE_KBDILLUMUP))
808 (define-public SDLK_EJECT (scancode->keycode SDL_SCANCODE_EJECT))
809 (define-public SDLK_SLEEP (scancode->keycode SDL_SCANCODE_SLEEP))
810
811 \f
812 ;;;
813 ;;; Mouse
814 ;;;
815
816 (define-public SDL_BUTTON_LEFT 1)
817 (define-public SDL_BUTTON_MIDDLE 2)
818 (define-public SDL_BUTTON_RIGHT 3)
819 (define-public SDL_BUTTON_X1 4)
820 (define-public SDL_BUTTON_X2 5)
821
822 (define (button-mask n)
823 (ash 1 (1- n)))
824
825 (define-public SDL_BUTTON_LMASK (button-mask SDL_BUTTON_LEFT))
826 (define-public SDL_BUTTON_MMASK (button-mask SDL_BUTTON_MIDDLE))
827 (define-public SDL_BUTTON_RMASK (button-mask SDL_BUTTON_RIGHT))
828 (define-public SDL_BUTTON_X1MASK (button-mask SDL_BUTTON_X1))
829 (define-public SDL_BUTTON_X2MASK (button-mask SDL_BUTTON_X2))
830
831
832 \f
833 ;;;
834 ;;; Timer
835 ;;;
836
837 (define-foreign sdl-get-ticks
838 uint32 "SDL_GetTicks" '())
839
840 \f
841 ;;;
842 ;;; File I/O
843 ;;;
844
845 (define-foreign sdl-rw-from-file
846 '* "SDL_RWFromFile" (list '* '*))
847
848 \f
849 ;;;
850 ;;; Surface
851 ;;;
852
853 (define-foreign sdl-free-surface
854 void "SDL_FreeSurface" '(*))
855
856 (define-foreign sdl-load-bmp-rw
857 '* "SDL_LoadBMP_RW" (list '* int))