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