windows: Fix SDL2_mixer DLL name.
[guile-sdl2.git] / sdl2 / bindings.scm
1 ;;; guile-sdl2 --- FFI bindings for SDL2
2 ;;; Copyright © 2015, 2016 David Thompson <davet@gnu.org>
3 ;;; Copyright © 2018 Eero Leno <eero@leno.fi>
4 ;;; Copyright © 2019 Pierre-Antoine Rouby <contact@parouby.fr>
5 ;;;
6 ;;; This file is part of guile-sdl2.
7 ;;;
8 ;;; Guile-sdl2 is free software; you can redistribute it and/or modify
9 ;;; it under the terms of the GNU Lesser General Public License as
10 ;;; published by the Free Software Foundation; either version 3 of the
11 ;;; License, or (at your option) any later version.
12 ;;;
13 ;;; Guile-sdl2 is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 ;;; General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU Lesser General Public
19 ;;; License along with guile-sdl2. If not, see
20 ;;; <http://www.gnu.org/licenses/>.
21
22 ;;; Commentary:
23 ;;
24 ;; Low-level FFI bindings.
25 ;;
26 ;;; Code:
27
28 (define-module (sdl2 bindings)
29 #:use-module (system foreign)
30 #:use-module (sdl2 config))
31
32 (define sdl-func
33 (let ((lib (dynamic-link %libsdl2)))
34 (lambda (return-type function-name arg-types)
35 "Return a procedure for the foreign function FUNCTION-NAME in
36 the SDL2 shared library. That function must return a value of
37 RETURN-TYPE and accept arguments of ARG-TYPES."
38 (pointer->procedure return-type
39 (dynamic-func function-name lib)
40 arg-types))))
41
42 (define-syntax-rule (define-foreign name return-type func-name arg-types)
43 (define-public name
44 (sdl-func return-type func-name arg-types)))
45
46 \f
47 ;;;
48 ;;; Foreign Types
49 ;;;
50
51 (define-public sdl-color
52 (list uint8 uint8 uint8 uint8))
53
54 (define-public sdl-rect
55 (list int int int int))
56
57 (define-public sdl-point
58 (list int int))
59
60 (define sdl-bool int)
61
62 (define-public (boolean->sdl-bool b)
63 "Convert the boolean B to an SDL_bool."
64 (if b 1 0))
65
66 \f
67 ;;;
68 ;;; Errors
69 ;;;
70
71 (define-foreign sdl-get-error
72 '* "SDL_GetError" '())
73
74 \f
75 ;;;
76 ;;; Initialization
77 ;;;
78
79 (define-public SDL_INIT_TIMER #x00000001)
80 (define-public SDL_INIT_AUDIO #x00000010)
81 (define-public SDL_INIT_VIDEO #x00000020)
82 (define-public SDL_INIT_JOYSTICK #x00000200)
83 (define-public SDL_INIT_HAPTIC #x00001000)
84 (define-public SDL_INIT_GAMECONTROLLER #x00002000)
85 (define-public SDL_INIT_EVENTS #x00004000)
86
87 (define-foreign sdl-init
88 int "SDL_Init" (list uint32))
89
90 (define-foreign sdl-quit
91 void "SDL_Quit" '())
92
93 \f
94 ;;;
95 ;;; Version
96 ;;;
97
98 (define-foreign sdl-get-version
99 void "SDL_GetVersion" '(*))
100
101 \f
102 ;;;
103 ;;; Video
104 ;;;
105
106 (define-public SDL_WINDOW_FULLSCREEN #x00000001)
107 (define-public SDL_WINDOW_OPENGL #x00000002)
108 (define-public SDL_WINDOW_SHOWN #x00000004)
109 (define-public SDL_WINDOW_HIDDEN #x00000008)
110 (define-public SDL_WINDOW_BORDERLESS #x00000010)
111 (define-public SDL_WINDOW_RESIZABLE #x00000020)
112 (define-public SDL_WINDOW_MINIMIZED #x00000040)
113 (define-public SDL_WINDOW_MAXIMIZED #x00000080)
114 (define-public SDL_WINDOW_INPUT_GRABBED #x00000100)
115 (define-public SDL_WINDOW_INPUT_FOCUS #x00000200)
116 (define-public SDL_WINDOW_MOUSE_FOCUS #x00000400)
117 (define-public SDL_WINDOW_FULLSCREEN_DESKTOP (logior SDL_WINDOW_FULLSCREEN
118 #x00001000))
119 (define-public SDL_WINDOW_FOREIGN #x00000800)
120 (define-public SDL_WINDOW_ALLOW_HIGHDPI #x00002000)
121 (define-public SDL_WINDOW_MOUSE_CAPTURE #x00004000)
122
123 (define-public SDL_WINDOWPOS_CENTERED 805240832)
124 (define-public SDL_WINDOWPOS_UNDEFINED 536805376)
125
126 (define-foreign sdl-create-window
127 '* "SDL_CreateWindow" (list '* int int int int uint32))
128
129 (define-foreign sdl-destroy-window
130 void "SDL_DestroyWindow" '(*))
131
132 (define-foreign sdl-get-window-title
133 '* "SDL_GetWindowTitle" '(*))
134
135 (define-foreign sdl-get-window-size
136 void "SDL_GetWindowSize" '(* * *))
137
138 (define-foreign sdl-get-window-position
139 void "SDL_GetWindowPosition" '(* * *))
140
141 (define-foreign sdl-get-window-id
142 uint32 "SDL_GetWindowID" '(*))
143
144 (define-foreign sdl-get-window-from-id
145 '* "SDL_GetWindowFromID" (list uint32))
146
147 (define-foreign sdl-hide-window
148 void "SDL_HideWindow" '(*))
149
150 (define-foreign sdl-show-window
151 void "SDL_ShowWindow" '(*))
152
153 (define-foreign sdl-maximize-window
154 void "SDL_MaximizeWindow" '(*))
155
156 (define-foreign sdl-minimize-window
157 void "SDL_MinimizeWindow" '(*))
158
159 (define-foreign sdl-raise-window
160 void "SDL_RaiseWindow" '(*))
161
162 (define-foreign sdl-restore-window
163 void "SDL_RestoreWindow" '(*))
164
165 (define-foreign sdl-set-window-bordered
166 void "SDL_SetWindowBordered" (list '* sdl-bool))
167
168 (define-foreign sdl-set-window-title
169 void "SDL_SetWindowTitle" '(* *))
170
171 (define-foreign sdl-set-window-position
172 void "SDL_SetWindowPosition" (list '* int int))
173
174 (define-foreign sdl-set-window-size
175 void "SDL_SetWindowSize" (list '* int int))
176
177 (define-foreign sdl-set-window-fullscreen
178 int "SDL_SetWindowFullscreen" (list '* uint32))
179
180 (define-foreign sdl-gl-create-context
181 '* "SDL_GL_CreateContext" '(*))
182
183 (define-foreign sdl-gl-delete-context
184 void "SDL_GL_DeleteContext" '(*))
185
186 (define-foreign sdl-gl-swap-window
187 void "SDL_GL_SwapWindow" '(*))
188
189 (define-public SDL_GL_RED_SIZE 0)
190 (define-public SDL_GL_GREEN_SIZE 1)
191 (define-public SDL_GL_BLUE_SIZE 2)
192 (define-public SDL_GL_ALPHA_SIZE 3)
193 (define-public SDL_GL_BUFFER_SIZE 4)
194 (define-public SDL_GL_DOUBLEBUFFER 5)
195 (define-public SDL_GL_DEPTH_SIZE 6)
196 (define-public SDL_GL_STENCIL_SIZE 7)
197 (define-public SDL_GL_ACCUM_RED_SIZE 8)
198 (define-public SDL_GL_ACCUM_GREEN_SIZE 9)
199 (define-public SDL_GL_ACCUM_BLUE_SIZE 10)
200 (define-public SDL_GL_ACCUM_ALPHA_SIZE 11)
201 (define-public SDL_GL_STEREO 12)
202 (define-public SDL_GL_MULTISAMPLEBUFFERS 13)
203 (define-public SDL_GL_MULTISAMPLESAMPLES 14)
204 (define-public SDL_GL_ACCELERATED_VISUAL 15)
205 (define-public SDL_GL_RETAINED_BACKING 16)
206 (define-public SDL_GL_CONTEXT_MAJOR_VERSION 17)
207 (define-public SDL_GL_CONTEXT_MINOR_VERSION 18)
208 (define-public SDL_GL_CONTEXT_EGL 19)
209 (define-public SDL_GL_CONTEXT_FLAGS 20)
210 (define-public SDL_GL_CONTEXT_PROFILE_MASK 21)
211 (define-public SDL_GL_SHARE_WITH_CURRENT_CONTEXT 22)
212 (define-public SDL_GL_FRAMEBUFFER_SRGB_CAPABLE 23)
213
214 (define-foreign sdl-gl-set-attribute
215 int "SDL_GL_SetAttribute" (list int int))
216
217 (define-foreign sdl-gl-set-swap-interval
218 int "SDL_GL_SetSwapInterval" (list int))
219
220 (define-public SDL_RENDERER_SOFTWARE #x00000001)
221 (define-public SDL_RENDERER_ACCELERATED #x00000002)
222 (define-public SDL_RENDERER_PRESENTVSYNC #x00000004)
223 (define-public SDL_RENDERER_TARGETTEXTURE #x00000008)
224
225 (define-foreign sdl-create-renderer
226 '* "SDL_CreateRenderer" (list '* int uint32))
227
228 (define-foreign sdl-destroy-renderer
229 void "SDL_DestroyRenderer" '(*))
230
231 (define-foreign sdl-render-clear
232 int "SDL_RenderClear" '(*))
233
234 (define-foreign sdl-render-present
235 void "SDL_RenderPresent" '(*))
236
237 (define-foreign sdl-render-copy
238 int "SDL_RenderCopy" '(* * * *))
239
240 (define-foreign sdl-render-copy-ex
241 int "SDL_RenderCopyEx" (list '* '* '* '* double '* int))
242
243 (define-public SDL_TEXTUREACCESS_STATIC 0)
244 (define-public SDL_TEXTUREACCESS_STREAMING 1)
245 (define-public SDL_TEXTUREACCESS_TARGET 2)
246
247 (define-foreign sdl-create-texture
248 '* "SDL_CreateTexture" (list '* uint32 int int int))
249
250 (define-foreign sdl-set-render-target
251 int "SDL_SetRenderTarget" '(* *))
252
253 (define-foreign sdl-get-render-target
254 '* "SDL_GetRenderTarget" '(*))
255
256 (define-foreign sdl-create-texture-from-surface
257 '* "SDL_CreateTextureFromSurface" '(* *))
258
259 (define-foreign sdl-destroy-texture
260 void "SDL_DestroyTexture" '(*))
261
262 (define-foreign sdl-set-texture-color-mod
263 int "SDL_SetTextureColorMod" (list '* uint8 uint8 uint8))
264
265 (define-foreign sdl-get-texture-color-mod
266 int "SDL_GetTextureColorMod" '(* * * *))
267
268 (define-foreign sdl-set-texture-alpha-mod
269 int "SDL_SetTextureAlphaMod" (list '* uint8))
270
271 (define-foreign sdl-get-texture-alpha-mod
272 int "SDL_GetTextureAlphaMod" '(* *))
273
274 (define-foreign sdl-set-render-draw-color
275 int "SDL_SetRenderDrawColor" (list '* uint8 uint8 uint8 uint8))
276
277 (define-foreign sdl-render-draw-line
278 int "SDL_RenderDrawLine" (list '* int int int int))
279
280 (define-foreign sdl-render-draw-lines
281 int "SDL_RenderDrawLines" (list '* '* int))
282
283 (define-foreign sdl-render-draw-point
284 int "SDL_RenderDrawPoint" (list '* int int))
285
286 (define-foreign sdl-render-draw-points
287 int "SDL_RenderDrawPoints" (list '* '* int))
288
289 (define-foreign sdl-render-draw-rect
290 int "SDL_RenderDrawRect" (list '* '*))
291
292 (define-foreign sdl-render-draw-rects
293 int "SDL_RenderDrawRects" (list '* '* int))
294
295 (define-foreign sdl-render-fill-rect
296 int "SDL_RenderFillRect" (list '* '*))
297
298 (define-foreign sdl-render-fill-rects
299 int "SDL_RenderFillRects" (list '* '* int))
300
301 \f
302 ;;;
303 ;;; Events
304 ;;;
305
306 (define-public SDL_QUIT #x100)
307 (define-public SDL_APP_TERMINATING #x101)
308 (define-public SDL_APP_LOWMEMORY #x102)
309 (define-public SDL_APP_WILLENTERBACKGROUND #x103)
310 (define-public SDL_APP_DIDENTERBACKGROUND #x104)
311 (define-public SDL_APP_WILLENTERFOREGROUND #x105)
312 (define-public SDL_APP_DIDENTERFOREGROUND #x106)
313 (define-public SDL_WINDOWEVENT #x200)
314 (define-public SDL_SYSWMEVENT #x201)
315 (define-public SDL_KEYDOWN #x300)
316 (define-public SDL_KEYUP #x301)
317 (define-public SDL_TEXTEDITING #x302)
318 (define-public SDL_TEXTINPUT #x303)
319 (define-public SDL_MOUSEMOTION #x400)
320 (define-public SDL_MOUSEBUTTONDOWN #x401)
321 (define-public SDL_MOUSEBUTTONUP #x402)
322 (define-public SDL_MOUSEWHEEL #x403)
323 (define-public SDL_JOYAXISMOTION #x600)
324 (define-public SDL_JOYBALLMOTION #x601)
325 (define-public SDL_JOYHATMOTION #x602)
326 (define-public SDL_JOYBUTTONDOWN #x603)
327 (define-public SDL_JOYBUTTONUP #x604)
328 (define-public SDL_JOYDEVICEADDED #x605)
329 (define-public SDL_JOYDEVICEREMOVED #x606)
330 (define-public SDL_CONTROLLERAXISMOTION #x650)
331 (define-public SDL_CONTROLLERBUTTONDOWN #x651)
332 (define-public SDL_CONTROLLERBUTTONUP #x652)
333 (define-public SDL_CONTROLLERDEVICEADDED #x653)
334 (define-public SDL_CONTROLLERDEVICEREMOVED #x654)
335 (define-public SDL_CONTROLLERDEVICEREMAPPED #x655)
336 (define-public SDL_FINGERDOWN #x700)
337 (define-public SDL_FINGERUP #x701)
338 (define-public SDL_FINGERMOTION #x702)
339 (define-public SDL_DOLLARGESTURE #x800)
340 (define-public SDL_DOLLARRECORD #x801)
341 (define-public SDL_MULTIGESTURE #x802)
342 (define-public SDL_CLIPBOARDUPDATE #x900)
343 (define-public SDL_DROPFILE #x1000)
344 (define-public SDL_RENDER_TARGETS_RESET #x2000)
345 (define-public SDL_USEREVENT #x8000)
346
347 (define-public SDL_RELEASED 0)
348 (define-public SDL_PRESSED 1)
349
350 (define-public SDL_WINDOWEVENT_NONE 0)
351 (define-public SDL_WINDOWEVENT_SHOWN 1)
352 (define-public SDL_WINDOWEVENT_HIDDEN 2)
353 (define-public SDL_WINDOWEVENT_EXPOSED 3)
354 (define-public SDL_WINDOWEVENT_MOVED 4)
355 (define-public SDL_WINDOWEVENT_RESIZED 5)
356 (define-public SDL_WINDOWEVENT_SIZE_CHANGED 6)
357 (define-public SDL_WINDOWEVENT_MINIMIZED 7)
358 (define-public SDL_WINDOWEVENT_MAXIMIZED 8)
359 (define-public SDL_WINDOWEVENT_RESTORED 9)
360 (define-public SDL_WINDOWEVENT_ENTER 10)
361 (define-public SDL_WINDOWEVENT_LEAVE 11)
362 (define-public SDL_WINDOWEVENT_FOCUS_GAINED 12)
363 (define-public SDL_WINDOWEVENT_FOCUS_LOST 13)
364 (define-public SDL_WINDOWEVENT_CLOSE 14)
365
366 (define-foreign sdl-poll-event
367 int "SDL_PollEvent" '(*))
368
369 \f
370 ;;;
371 ;;; Keycodes and scancodes
372 ;;;
373
374 (define-public KMOD_NONE #x0000)
375 (define-public KMOD_LSHIFT #x0001)
376 (define-public KMOD_RSHIFT #x0002)
377 (define-public KMOD_LCTRL #x0040)
378 (define-public KMOD_RCTRL #x0080)
379 (define-public KMOD_LALT #x0100)
380 (define-public KMOD_RALT #x0200)
381 (define-public KMOD_LGUI #x0400)
382 (define-public KMOD_RGUI #x0800)
383 (define-public KMOD_NUM #x1000)
384 (define-public KMOD_CAPS #x2000)
385 (define-public KMOD_MODE #x4000)
386
387 (define-public SDLK_SCANCODE_MASK (ash 1 30))
388
389 (define-public (scancode->keycode scancode)
390 (logior scancode SDLK_SCANCODE_MASK))
391
392 (define-public SDL_SCANCODE_UNKNOWN 0)
393 (define-public SDL_SCANCODE_A 4)
394 (define-public SDL_SCANCODE_B 5)
395 (define-public SDL_SCANCODE_C 6)
396 (define-public SDL_SCANCODE_D 7)
397 (define-public SDL_SCANCODE_E 8)
398 (define-public SDL_SCANCODE_F 9)
399 (define-public SDL_SCANCODE_G 10)
400 (define-public SDL_SCANCODE_H 11)
401 (define-public SDL_SCANCODE_I 12)
402 (define-public SDL_SCANCODE_J 13)
403 (define-public SDL_SCANCODE_K 14)
404 (define-public SDL_SCANCODE_L 15)
405 (define-public SDL_SCANCODE_M 16)
406 (define-public SDL_SCANCODE_N 17)
407 (define-public SDL_SCANCODE_O 18)
408 (define-public SDL_SCANCODE_P 19)
409 (define-public SDL_SCANCODE_Q 20)
410 (define-public SDL_SCANCODE_R 21)
411 (define-public SDL_SCANCODE_S 22)
412 (define-public SDL_SCANCODE_T 23)
413 (define-public SDL_SCANCODE_U 24)
414 (define-public SDL_SCANCODE_V 25)
415 (define-public SDL_SCANCODE_W 26)
416 (define-public SDL_SCANCODE_X 27)
417 (define-public SDL_SCANCODE_Y 28)
418 (define-public SDL_SCANCODE_Z 29)
419 (define-public SDL_SCANCODE_1 30)
420 (define-public SDL_SCANCODE_2 31)
421 (define-public SDL_SCANCODE_3 32)
422 (define-public SDL_SCANCODE_4 33)
423 (define-public SDL_SCANCODE_5 34)
424 (define-public SDL_SCANCODE_6 35)
425 (define-public SDL_SCANCODE_7 36)
426 (define-public SDL_SCANCODE_8 37)
427 (define-public SDL_SCANCODE_9 38)
428 (define-public SDL_SCANCODE_0 39)
429 (define-public SDL_SCANCODE_RETURN 40)
430 (define-public SDL_SCANCODE_ESCAPE 41)
431 (define-public SDL_SCANCODE_BACKSPACE 42)
432 (define-public SDL_SCANCODE_TAB 43)
433 (define-public SDL_SCANCODE_SPACE 44)
434 (define-public SDL_SCANCODE_MINUS 45)
435 (define-public SDL_SCANCODE_EQUALS 46)
436 (define-public SDL_SCANCODE_LEFTBRACKET 47)
437 (define-public SDL_SCANCODE_RIGHTBRACKET 48)
438 (define-public SDL_SCANCODE_BACKSLASH 49)
439 (define-public SDL_SCANCODE_NONUSHASH 50)
440 (define-public SDL_SCANCODE_SEMICOLON 51)
441 (define-public SDL_SCANCODE_APOSTROPHE 52)
442 (define-public SDL_SCANCODE_GRAVE 53)
443 (define-public SDL_SCANCODE_COMMA 54)
444 (define-public SDL_SCANCODE_PERIOD 55)
445 (define-public SDL_SCANCODE_SLASH 56)
446 (define-public SDL_SCANCODE_CAPSLOCK 57)
447 (define-public SDL_SCANCODE_F1 58)
448 (define-public SDL_SCANCODE_F2 59)
449 (define-public SDL_SCANCODE_F3 60)
450 (define-public SDL_SCANCODE_F4 61)
451 (define-public SDL_SCANCODE_F5 62)
452 (define-public SDL_SCANCODE_F6 63)
453 (define-public SDL_SCANCODE_F7 64)
454 (define-public SDL_SCANCODE_F8 65)
455 (define-public SDL_SCANCODE_F9 66)
456 (define-public SDL_SCANCODE_F10 67)
457 (define-public SDL_SCANCODE_F11 68)
458 (define-public SDL_SCANCODE_F12 69)
459 (define-public SDL_SCANCODE_PRINTSCREEN 70)
460 (define-public SDL_SCANCODE_SCROLLLOCK 71)
461 (define-public SDL_SCANCODE_PAUSE 72)
462 (define-public SDL_SCANCODE_INSERT 73)
463 (define-public SDL_SCANCODE_HOME 74)
464 (define-public SDL_SCANCODE_PAGEUP 75)
465 (define-public SDL_SCANCODE_DELETE 76)
466 (define-public SDL_SCANCODE_END 77)
467 (define-public SDL_SCANCODE_PAGEDOWN 78)
468 (define-public SDL_SCANCODE_RIGHT 79)
469 (define-public SDL_SCANCODE_LEFT 80)
470 (define-public SDL_SCANCODE_DOWN 81)
471 (define-public SDL_SCANCODE_UP 82)
472 (define-public SDL_SCANCODE_NUMLOCKCLEAR 83)
473 (define-public SDL_SCANCODE_KP_DIVIDE 84)
474 (define-public SDL_SCANCODE_KP_MULTIPLY 85)
475 (define-public SDL_SCANCODE_KP_MINUS 86)
476 (define-public SDL_SCANCODE_KP_PLUS 87)
477 (define-public SDL_SCANCODE_KP_ENTER 88)
478 (define-public SDL_SCANCODE_KP_1 89)
479 (define-public SDL_SCANCODE_KP_2 90)
480 (define-public SDL_SCANCODE_KP_3 91)
481 (define-public SDL_SCANCODE_KP_4 92)
482 (define-public SDL_SCANCODE_KP_5 93)
483 (define-public SDL_SCANCODE_KP_6 94)
484 (define-public SDL_SCANCODE_KP_7 95)
485 (define-public SDL_SCANCODE_KP_8 96)
486 (define-public SDL_SCANCODE_KP_9 97)
487 (define-public SDL_SCANCODE_KP_0 98)
488 (define-public SDL_SCANCODE_KP_PERIOD 99)
489 (define-public SDL_SCANCODE_NONUSBACKSLASH 100)
490 (define-public SDL_SCANCODE_APPLICATION 101)
491 (define-public SDL_SCANCODE_POWER 102)
492 (define-public SDL_SCANCODE_KP_EQUALS 103)
493 (define-public SDL_SCANCODE_F13 104)
494 (define-public SDL_SCANCODE_F14 105)
495 (define-public SDL_SCANCODE_F15 106)
496 (define-public SDL_SCANCODE_F16 107)
497 (define-public SDL_SCANCODE_F17 108)
498 (define-public SDL_SCANCODE_F18 109)
499 (define-public SDL_SCANCODE_F19 110)
500 (define-public SDL_SCANCODE_F20 111)
501 (define-public SDL_SCANCODE_F21 112)
502 (define-public SDL_SCANCODE_F22 113)
503 (define-public SDL_SCANCODE_F23 114)
504 (define-public SDL_SCANCODE_F24 115)
505 (define-public SDL_SCANCODE_EXECUTE 116)
506 (define-public SDL_SCANCODE_HELP 117)
507 (define-public SDL_SCANCODE_MENU 118)
508 (define-public SDL_SCANCODE_SELECT 119)
509 (define-public SDL_SCANCODE_STOP 120)
510 (define-public SDL_SCANCODE_AGAIN 121)
511 (define-public SDL_SCANCODE_UNDO 122)
512 (define-public SDL_SCANCODE_CUT 123)
513 (define-public SDL_SCANCODE_COPY 124)
514 (define-public SDL_SCANCODE_PASTE 125)
515 (define-public SDL_SCANCODE_FIND 126)
516 (define-public SDL_SCANCODE_MUTE 127)
517 (define-public SDL_SCANCODE_VOLUMEUP 128)
518 (define-public SDL_SCANCODE_VOLUMEDOWN 129)
519 (define-public SDL_SCANCODE_KP_COMMA 133)
520 (define-public SDL_SCANCODE_KP_EQUALSAS400 134)
521 (define-public SDL_SCANCODE_INTERNATIONAL1 135)
522 (define-public SDL_SCANCODE_INTERNATIONAL2 136)
523 (define-public SDL_SCANCODE_INTERNATIONAL3 137)
524 (define-public SDL_SCANCODE_INTERNATIONAL4 138)
525 (define-public SDL_SCANCODE_INTERNATIONAL5 139)
526 (define-public SDL_SCANCODE_INTERNATIONAL6 140)
527 (define-public SDL_SCANCODE_INTERNATIONAL7 141)
528 (define-public SDL_SCANCODE_INTERNATIONAL8 142)
529 (define-public SDL_SCANCODE_INTERNATIONAL9 143)
530 (define-public SDL_SCANCODE_LANG1 144)
531 (define-public SDL_SCANCODE_LANG2 145)
532 (define-public SDL_SCANCODE_LANG3 146)
533 (define-public SDL_SCANCODE_LANG4 147)
534 (define-public SDL_SCANCODE_LANG5 148)
535 (define-public SDL_SCANCODE_LANG6 149)
536 (define-public SDL_SCANCODE_LANG7 150)
537 (define-public SDL_SCANCODE_LANG8 151)
538 (define-public SDL_SCANCODE_LANG9 152)
539 (define-public SDL_SCANCODE_ALTERASE 153)
540 (define-public SDL_SCANCODE_SYSREQ 154)
541 (define-public SDL_SCANCODE_CANCEL 155)
542 (define-public SDL_SCANCODE_CLEAR 156)
543 (define-public SDL_SCANCODE_PRIOR 157)
544 (define-public SDL_SCANCODE_RETURN2 158)
545 (define-public SDL_SCANCODE_SEPARATOR 159)
546 (define-public SDL_SCANCODE_OUT 160)
547 (define-public SDL_SCANCODE_OPER 161)
548 (define-public SDL_SCANCODE_CLEARAGAIN 162)
549 (define-public SDL_SCANCODE_CRSEL 163)
550 (define-public SDL_SCANCODE_EXSEL 164)
551 (define-public SDL_SCANCODE_KP_00 176)
552 (define-public SDL_SCANCODE_KP_000 177)
553 (define-public SDL_SCANCODE_THOUSANDSSEPARATOR 178)
554 (define-public SDL_SCANCODE_DECIMALSEPARATOR 179)
555 (define-public SDL_SCANCODE_CURRENCYUNIT 180)
556 (define-public SDL_SCANCODE_CURRENCYSUBUNIT 181)
557 (define-public SDL_SCANCODE_KP_LEFTPAREN 182)
558 (define-public SDL_SCANCODE_KP_RIGHTPAREN 183)
559 (define-public SDL_SCANCODE_KP_LEFTBRACE 184)
560 (define-public SDL_SCANCODE_KP_RIGHTBRACE 185)
561 (define-public SDL_SCANCODE_KP_TAB 186)
562 (define-public SDL_SCANCODE_KP_BACKSPACE 187)
563 (define-public SDL_SCANCODE_KP_A 188)
564 (define-public SDL_SCANCODE_KP_B 189)
565 (define-public SDL_SCANCODE_KP_C 190)
566 (define-public SDL_SCANCODE_KP_D 191)
567 (define-public SDL_SCANCODE_KP_E 192)
568 (define-public SDL_SCANCODE_KP_F 193)
569 (define-public SDL_SCANCODE_KP_XOR 194)
570 (define-public SDL_SCANCODE_KP_POWER 195)
571 (define-public SDL_SCANCODE_KP_PERCENT 196)
572 (define-public SDL_SCANCODE_KP_LESS 197)
573 (define-public SDL_SCANCODE_KP_GREATER 198)
574 (define-public SDL_SCANCODE_KP_AMPERSAND 199)
575 (define-public SDL_SCANCODE_KP_DBLAMPERSAND 200)
576 (define-public SDL_SCANCODE_KP_VERTICALBAR 201)
577 (define-public SDL_SCANCODE_KP_DBLVERTICALBAR 202)
578 (define-public SDL_SCANCODE_KP_COLON 203)
579 (define-public SDL_SCANCODE_KP_HASH 204)
580 (define-public SDL_SCANCODE_KP_SPACE 205)
581 (define-public SDL_SCANCODE_KP_AT 206)
582 (define-public SDL_SCANCODE_KP_EXCLAM 207)
583 (define-public SDL_SCANCODE_KP_MEMSTORE 208)
584 (define-public SDL_SCANCODE_KP_MEMRECALL 209)
585 (define-public SDL_SCANCODE_KP_MEMCLEAR 210)
586 (define-public SDL_SCANCODE_KP_MEMADD 211)
587 (define-public SDL_SCANCODE_KP_MEMSUBTRACT 212)
588 (define-public SDL_SCANCODE_KP_MEMMULTIPLY 213)
589 (define-public SDL_SCANCODE_KP_MEMDIVIDE 214)
590 (define-public SDL_SCANCODE_KP_PLUSMINUS 215)
591 (define-public SDL_SCANCODE_KP_CLEAR 216)
592 (define-public SDL_SCANCODE_KP_CLEARENTRY 217)
593 (define-public SDL_SCANCODE_KP_BINARY 218)
594 (define-public SDL_SCANCODE_KP_OCTAL 219)
595 (define-public SDL_SCANCODE_KP_DECIMAL 220)
596 (define-public SDL_SCANCODE_KP_HEXADECIMAL 221)
597 (define-public SDL_SCANCODE_LCTRL 224)
598 (define-public SDL_SCANCODE_LSHIFT 225)
599 (define-public SDL_SCANCODE_LALT 226)
600 (define-public SDL_SCANCODE_LGUI 227)
601 (define-public SDL_SCANCODE_RCTRL 228)
602 (define-public SDL_SCANCODE_RSHIFT 229)
603 (define-public SDL_SCANCODE_RALT 230)
604 (define-public SDL_SCANCODE_RGUI 231)
605 (define-public SDL_SCANCODE_MODE 257)
606 (define-public SDL_SCANCODE_AUDIONEXT 258)
607 (define-public SDL_SCANCODE_AUDIOPREV 259)
608 (define-public SDL_SCANCODE_AUDIOSTOP 260)
609 (define-public SDL_SCANCODE_AUDIOPLAY 261)
610 (define-public SDL_SCANCODE_AUDIOMUTE 262)
611 (define-public SDL_SCANCODE_MEDIASELECT 263)
612 (define-public SDL_SCANCODE_WWW 264)
613 (define-public SDL_SCANCODE_MAIL 265)
614 (define-public SDL_SCANCODE_CALCULATOR 266)
615 (define-public SDL_SCANCODE_COMPUTER 267)
616 (define-public SDL_SCANCODE_AC_SEARCH 268)
617 (define-public SDL_SCANCODE_AC_HOME 269)
618 (define-public SDL_SCANCODE_AC_BACK 270)
619 (define-public SDL_SCANCODE_AC_FORWARD 271)
620 (define-public SDL_SCANCODE_AC_STOP 272)
621 (define-public SDL_SCANCODE_AC_REFRESH 273)
622 (define-public SDL_SCANCODE_AC_BOOKMARKS 274)
623 (define-public SDL_SCANCODE_BRIGHTNESSDOWN 275)
624 (define-public SDL_SCANCODE_BRIGHTNESSUP 276)
625 (define-public SDL_SCANCODE_DISPLAYSWITCH 277)
626 (define-public SDL_SCANCODE_KBDILLUMTOGGLE 278)
627 (define-public SDL_SCANCODE_KBDILLUMDOWN 279)
628 (define-public SDL_SCANCODE_KBDILLUMUP 280)
629 (define-public SDL_SCANCODE_EJECT 281)
630 (define-public SDL_SCANCODE_SLEEP 282)
631 (define-public SDL_SCANCODE_APP1 283)
632 (define-public SDL_SCANCODE_APP2 284)
633 (define-public SDL_NUM_SCANCODES 512)
634
635 (define-public SDLK_UNKNOWN 0)
636 (define-public SDLK_RETURN 13)
637 (define-public SDLK_ESCAPE 27)
638 (define-public SDLK_BACKSPACE 8)
639 (define-public SDLK_TAB 9)
640 (define-public SDLK_SPACE 32)
641 (define-public SDLK_EXCLAIM 33)
642 (define-public SDLK_QUOTEDBL 34)
643 (define-public SDLK_HASH 35)
644 (define-public SDLK_PERCENT 37)
645 (define-public SDLK_DOLLAR 36)
646 (define-public SDLK_AMPERSAND 38)
647 (define-public SDLK_QUOTE 39)
648 (define-public SDLK_LEFTPAREN 40)
649 (define-public SDLK_RIGHTPAREN 41)
650 (define-public SDLK_ASTERISK 42)
651 (define-public SDLK_PLUS 43)
652 (define-public SDLK_COMMA 44)
653 (define-public SDLK_MINUS 45)
654 (define-public SDLK_PERIOD 46)
655 (define-public SDLK_SLASH 47)
656 (define-public SDLK_0 48)
657 (define-public SDLK_1 49)
658 (define-public SDLK_2 50)
659 (define-public SDLK_3 51)
660 (define-public SDLK_4 52)
661 (define-public SDLK_5 53)
662 (define-public SDLK_6 54)
663 (define-public SDLK_7 55)
664 (define-public SDLK_8 56)
665 (define-public SDLK_9 57)
666 (define-public SDLK_COLON 58)
667 (define-public SDLK_SEMICOLON 59)
668 (define-public SDLK_LESS 60)
669 (define-public SDLK_EQUALS 61)
670 (define-public SDLK_GREATER 62)
671 (define-public SDLK_QUESTION 63)
672 (define-public SDLK_AT 64)
673 (define-public SDLK_LEFTBRACKET 91)
674 (define-public SDLK_BACKSLASH 92)
675 (define-public SDLK_RIGHTBRACKET 93)
676 (define-public SDLK_CARET 94)
677 (define-public SDLK_UNDERSCORE 95)
678 (define-public SDLK_BACKQUOTE 96)
679 (define-public SDLK_a 97)
680 (define-public SDLK_b 98)
681 (define-public SDLK_c 99)
682 (define-public SDLK_d 100)
683 (define-public SDLK_e 101)
684 (define-public SDLK_f 102)
685 (define-public SDLK_g 103)
686 (define-public SDLK_h 104)
687 (define-public SDLK_i 105)
688 (define-public SDLK_j 106)
689 (define-public SDLK_k 107)
690 (define-public SDLK_l 108)
691 (define-public SDLK_m 109)
692 (define-public SDLK_n 110)
693 (define-public SDLK_o 111)
694 (define-public SDLK_p 112)
695 (define-public SDLK_q 113)
696 (define-public SDLK_r 114)
697 (define-public SDLK_s 115)
698 (define-public SDLK_t 116)
699 (define-public SDLK_u 117)
700 (define-public SDLK_v 118)
701 (define-public SDLK_w 119)
702 (define-public SDLK_x 120)
703 (define-public SDLK_y 121)
704 (define-public SDLK_z 122)
705 (define-public SDLK_CAPSLOCK (scancode->keycode SDL_SCANCODE_CAPSLOCK))
706 (define-public SDLK_F1 (scancode->keycode SDL_SCANCODE_F1))
707 (define-public SDLK_F2 (scancode->keycode SDL_SCANCODE_F2))
708 (define-public SDLK_F3 (scancode->keycode SDL_SCANCODE_F3))
709 (define-public SDLK_F4 (scancode->keycode SDL_SCANCODE_F4))
710 (define-public SDLK_F5 (scancode->keycode SDL_SCANCODE_F5))
711 (define-public SDLK_F6 (scancode->keycode SDL_SCANCODE_F6))
712 (define-public SDLK_F7 (scancode->keycode SDL_SCANCODE_F7))
713 (define-public SDLK_F8 (scancode->keycode SDL_SCANCODE_F8))
714 (define-public SDLK_F9 (scancode->keycode SDL_SCANCODE_F9))
715 (define-public SDLK_F10 (scancode->keycode SDL_SCANCODE_F10))
716 (define-public SDLK_F11 (scancode->keycode SDL_SCANCODE_F11))
717 (define-public SDLK_F12 (scancode->keycode SDL_SCANCODE_F12))
718 (define-public SDLK_PRINTSCREEN (scancode->keycode SDL_SCANCODE_PRINTSCREEN))
719 (define-public SDLK_SCROLLLOCK (scancode->keycode SDL_SCANCODE_SCROLLLOCK))
720 (define-public SDLK_PAUSE (scancode->keycode SDL_SCANCODE_PAUSE))
721 (define-public SDLK_INSERT (scancode->keycode SDL_SCANCODE_INSERT))
722 (define-public SDLK_HOME (scancode->keycode SDL_SCANCODE_HOME))
723 (define-public SDLK_PAGEUP (scancode->keycode SDL_SCANCODE_PAGEUP))
724 (define-public SDLK_DELETE 127)
725 (define-public SDLK_END (scancode->keycode SDL_SCANCODE_END))
726 (define-public SDLK_PAGEDOWN (scancode->keycode SDL_SCANCODE_PAGEDOWN))
727 (define-public SDLK_RIGHT (scancode->keycode SDL_SCANCODE_RIGHT))
728 (define-public SDLK_LEFT (scancode->keycode SDL_SCANCODE_LEFT))
729 (define-public SDLK_DOWN (scancode->keycode SDL_SCANCODE_DOWN))
730 (define-public SDLK_UP (scancode->keycode SDL_SCANCODE_UP))
731 (define-public SDLK_NUMLOCKCLEAR (scancode->keycode SDL_SCANCODE_NUMLOCKCLEAR))
732 (define-public SDLK_KP_DIVIDE (scancode->keycode SDL_SCANCODE_KP_DIVIDE))
733 (define-public SDLK_KP_MULTIPLY (scancode->keycode SDL_SCANCODE_KP_MULTIPLY))
734 (define-public SDLK_KP_MINUS (scancode->keycode SDL_SCANCODE_KP_MINUS))
735 (define-public SDLK_KP_PLUS (scancode->keycode SDL_SCANCODE_KP_PLUS))
736 (define-public SDLK_KP_ENTER (scancode->keycode SDL_SCANCODE_KP_ENTER))
737 (define-public SDLK_KP_1 (scancode->keycode SDL_SCANCODE_KP_1))
738 (define-public SDLK_KP_2 (scancode->keycode SDL_SCANCODE_KP_2))
739 (define-public SDLK_KP_3 (scancode->keycode SDL_SCANCODE_KP_3))
740 (define-public SDLK_KP_4 (scancode->keycode SDL_SCANCODE_KP_4))
741 (define-public SDLK_KP_5 (scancode->keycode SDL_SCANCODE_KP_5))
742 (define-public SDLK_KP_6 (scancode->keycode SDL_SCANCODE_KP_6))
743 (define-public SDLK_KP_7 (scancode->keycode SDL_SCANCODE_KP_7))
744 (define-public SDLK_KP_8 (scancode->keycode SDL_SCANCODE_KP_8))
745 (define-public SDLK_KP_9 (scancode->keycode SDL_SCANCODE_KP_9))
746 (define-public SDLK_KP_0 (scancode->keycode SDL_SCANCODE_KP_0))
747 (define-public SDLK_KP_PERIOD (scancode->keycode SDL_SCANCODE_KP_PERIOD))
748 (define-public SDLK_APPLICATION (scancode->keycode SDL_SCANCODE_APPLICATION))
749 (define-public SDLK_POWER (scancode->keycode SDL_SCANCODE_POWER))
750 (define-public SDLK_KP_EQUALS (scancode->keycode SDL_SCANCODE_KP_EQUALS))
751 (define-public SDLK_F13 (scancode->keycode SDL_SCANCODE_F13))
752 (define-public SDLK_F14 (scancode->keycode SDL_SCANCODE_F14))
753 (define-public SDLK_F15 (scancode->keycode SDL_SCANCODE_F15))
754 (define-public SDLK_F16 (scancode->keycode SDL_SCANCODE_F16))
755 (define-public SDLK_F17 (scancode->keycode SDL_SCANCODE_F17))
756 (define-public SDLK_F18 (scancode->keycode SDL_SCANCODE_F18))
757 (define-public SDLK_F19 (scancode->keycode SDL_SCANCODE_F19))
758 (define-public SDLK_F20 (scancode->keycode SDL_SCANCODE_F20))
759 (define-public SDLK_F21 (scancode->keycode SDL_SCANCODE_F21))
760 (define-public SDLK_F22 (scancode->keycode SDL_SCANCODE_F22))
761 (define-public SDLK_F23 (scancode->keycode SDL_SCANCODE_F23))
762 (define-public SDLK_F24 (scancode->keycode SDL_SCANCODE_F24))
763 (define-public SDLK_EXECUTE (scancode->keycode SDL_SCANCODE_EXECUTE))
764 (define-public SDLK_HELP (scancode->keycode SDL_SCANCODE_HELP))
765 (define-public SDLK_MENU (scancode->keycode SDL_SCANCODE_MENU))
766 (define-public SDLK_SELECT (scancode->keycode SDL_SCANCODE_SELECT))
767 (define-public SDLK_STOP (scancode->keycode SDL_SCANCODE_STOP))
768 (define-public SDLK_AGAIN (scancode->keycode SDL_SCANCODE_AGAIN))
769 (define-public SDLK_UNDO (scancode->keycode SDL_SCANCODE_UNDO))
770 (define-public SDLK_CUT (scancode->keycode SDL_SCANCODE_CUT))
771 (define-public SDLK_COPY (scancode->keycode SDL_SCANCODE_COPY))
772 (define-public SDLK_PASTE (scancode->keycode SDL_SCANCODE_PASTE))
773 (define-public SDLK_FIND (scancode->keycode SDL_SCANCODE_FIND))
774 (define-public SDLK_MUTE (scancode->keycode SDL_SCANCODE_MUTE))
775 (define-public SDLK_VOLUMEUP (scancode->keycode SDL_SCANCODE_VOLUMEUP))
776 (define-public SDLK_VOLUMEDOWN (scancode->keycode SDL_SCANCODE_VOLUMEDOWN))
777 (define-public SDLK_KP_COMMA (scancode->keycode SDL_SCANCODE_KP_COMMA))
778 (define-public SDLK_KP_EQUALSAS400
779 (scancode->keycode SDL_SCANCODE_KP_EQUALSAS400))
780 (define-public SDLK_ALTERASE (scancode->keycode SDL_SCANCODE_ALTERASE))
781 (define-public SDLK_SYSREQ (scancode->keycode SDL_SCANCODE_SYSREQ))
782 (define-public SDLK_CANCEL (scancode->keycode SDL_SCANCODE_CANCEL))
783 (define-public SDLK_CLEAR (scancode->keycode SDL_SCANCODE_CLEAR))
784 (define-public SDLK_PRIOR (scancode->keycode SDL_SCANCODE_PRIOR))
785 (define-public SDLK_RETURN2 (scancode->keycode SDL_SCANCODE_RETURN2))
786 (define-public SDLK_SEPARATOR (scancode->keycode SDL_SCANCODE_SEPARATOR))
787 (define-public SDLK_OUT (scancode->keycode SDL_SCANCODE_OUT))
788 (define-public SDLK_OPER (scancode->keycode SDL_SCANCODE_OPER))
789 (define-public SDLK_CLEARAGAIN (scancode->keycode SDL_SCANCODE_CLEARAGAIN))
790 (define-public SDLK_CRSEL (scancode->keycode SDL_SCANCODE_CRSEL))
791 (define-public SDLK_EXSEL (scancode->keycode SDL_SCANCODE_EXSEL))
792 (define-public SDLK_KP_00 (scancode->keycode SDL_SCANCODE_KP_00))
793 (define-public SDLK_KP_000 (scancode->keycode SDL_SCANCODE_KP_000))
794 (define-public SDLK_THOUSANDSSEPARATOR
795 (scancode->keycode SDL_SCANCODE_THOUSANDSSEPARATOR))
796 (define-public SDLK_DECIMALSEPARATOR
797 (scancode->keycode SDL_SCANCODE_DECIMALSEPARATOR))
798 (define-public SDLK_CURRENCYUNIT (scancode->keycode SDL_SCANCODE_CURRENCYUNIT))
799 (define-public SDLK_CURRENCYSUBUNIT
800 (scancode->keycode SDL_SCANCODE_CURRENCYSUBUNIT))
801 (define-public SDLK_KP_LEFTPAREN (scancode->keycode SDL_SCANCODE_KP_LEFTPAREN))
802 (define-public SDLK_KP_RIGHTPAREN
803 (scancode->keycode SDL_SCANCODE_KP_RIGHTPAREN))
804 (define-public SDLK_KP_LEFTBRACE (scancode->keycode SDL_SCANCODE_KP_LEFTBRACE))
805 (define-public SDLK_KP_RIGHTBRACE (scancode->keycode SDL_SCANCODE_KP_RIGHTBRACE))
806 (define-public SDLK_KP_TAB (scancode->keycode SDL_SCANCODE_KP_TAB))
807 (define-public SDLK_KP_BACKSPACE (scancode->keycode SDL_SCANCODE_KP_BACKSPACE))
808 (define-public SDLK_KP_A (scancode->keycode SDL_SCANCODE_KP_A))
809 (define-public SDLK_KP_B (scancode->keycode SDL_SCANCODE_KP_B))
810 (define-public SDLK_KP_C (scancode->keycode SDL_SCANCODE_KP_C))
811 (define-public SDLK_KP_D (scancode->keycode SDL_SCANCODE_KP_D))
812 (define-public SDLK_KP_E (scancode->keycode SDL_SCANCODE_KP_E))
813 (define-public SDLK_KP_F (scancode->keycode SDL_SCANCODE_KP_F))
814 (define-public SDLK_KP_XOR (scancode->keycode SDL_SCANCODE_KP_XOR))
815 (define-public SDLK_KP_POWER (scancode->keycode SDL_SCANCODE_KP_POWER))
816 (define-public SDLK_KP_PERCENT (scancode->keycode SDL_SCANCODE_KP_PERCENT))
817 (define-public SDLK_KP_LESS (scancode->keycode SDL_SCANCODE_KP_LESS))
818 (define-public SDLK_KP_GREATER (scancode->keycode SDL_SCANCODE_KP_GREATER))
819 (define-public SDLK_KP_AMPERSAND (scancode->keycode SDL_SCANCODE_KP_AMPERSAND))
820 (define-public SDLK_KP_DBLAMPERSAND
821 (scancode->keycode SDL_SCANCODE_KP_DBLAMPERSAND))
822 (define-public SDLK_KP_VERTICALBAR
823 (scancode->keycode SDL_SCANCODE_KP_VERTICALBAR))
824 (define-public SDLK_KP_DBLVERTICALBAR
825 (scancode->keycode SDL_SCANCODE_KP_DBLVERTICALBAR))
826 (define-public SDLK_KP_COLON (scancode->keycode SDL_SCANCODE_KP_COLON))
827 (define-public SDLK_KP_HASH (scancode->keycode SDL_SCANCODE_KP_HASH))
828 (define-public SDLK_KP_SPACE (scancode->keycode SDL_SCANCODE_KP_SPACE))
829 (define-public SDLK_KP_AT (scancode->keycode SDL_SCANCODE_KP_AT))
830 (define-public SDLK_KP_EXCLAM (scancode->keycode SDL_SCANCODE_KP_EXCLAM))
831 (define-public SDLK_KP_MEMSTORE (scancode->keycode SDL_SCANCODE_KP_MEMSTORE))
832 (define-public SDLK_KP_MEMRECALL (scancode->keycode SDL_SCANCODE_KP_MEMRECALL))
833 (define-public SDLK_KP_MEMCLEAR (scancode->keycode SDL_SCANCODE_KP_MEMCLEAR))
834 (define-public SDLK_KP_MEMADD (scancode->keycode SDL_SCANCODE_KP_MEMADD))
835 (define-public SDLK_KP_MEMSUBTRACT
836 (scancode->keycode SDL_SCANCODE_KP_MEMSUBTRACT))
837 (define-public SDLK_KP_MEMMULTIPLY
838 (scancode->keycode SDL_SCANCODE_KP_MEMMULTIPLY))
839 (define-public SDLK_KP_MEMDIVIDE (scancode->keycode SDL_SCANCODE_KP_MEMDIVIDE))
840 (define-public SDLK_KP_PLUSMINUS (scancode->keycode SDL_SCANCODE_KP_PLUSMINUS))
841 (define-public SDLK_KP_CLEAR (scancode->keycode SDL_SCANCODE_KP_CLEAR))
842 (define-public SDLK_KP_CLEARENTRY (scancode->keycode SDL_SCANCODE_KP_CLEARENTRY))
843 (define-public SDLK_KP_BINARY (scancode->keycode SDL_SCANCODE_KP_BINARY))
844 (define-public SDLK_KP_OCTAL (scancode->keycode SDL_SCANCODE_KP_OCTAL))
845 (define-public SDLK_KP_DECIMAL (scancode->keycode SDL_SCANCODE_KP_DECIMAL))
846 (define-public SDLK_KP_HEXADECIMAL
847 (scancode->keycode SDL_SCANCODE_KP_HEXADECIMAL))
848 (define-public SDLK_LCTRL (scancode->keycode SDL_SCANCODE_LCTRL))
849 (define-public SDLK_LSHIFT (scancode->keycode SDL_SCANCODE_LSHIFT))
850 (define-public SDLK_LALT (scancode->keycode SDL_SCANCODE_LALT))
851 (define-public SDLK_LGUI (scancode->keycode SDL_SCANCODE_LGUI))
852 (define-public SDLK_RCTRL (scancode->keycode SDL_SCANCODE_RCTRL))
853 (define-public SDLK_RSHIFT (scancode->keycode SDL_SCANCODE_RSHIFT))
854 (define-public SDLK_RALT (scancode->keycode SDL_SCANCODE_RALT))
855 (define-public SDLK_RGUI (scancode->keycode SDL_SCANCODE_RGUI))
856 (define-public SDLK_MODE (scancode->keycode SDL_SCANCODE_MODE))
857 (define-public SDLK_AUDIONEXT (scancode->keycode SDL_SCANCODE_AUDIONEXT))
858 (define-public SDLK_AUDIOPREV (scancode->keycode SDL_SCANCODE_AUDIOPREV))
859 (define-public SDLK_AUDIOSTOP (scancode->keycode SDL_SCANCODE_AUDIOSTOP))
860 (define-public SDLK_AUDIOPLAY (scancode->keycode SDL_SCANCODE_AUDIOPLAY))
861 (define-public SDLK_AUDIOMUTE (scancode->keycode SDL_SCANCODE_AUDIOMUTE))
862 (define-public SDLK_MEDIASELECT (scancode->keycode SDL_SCANCODE_MEDIASELECT))
863 (define-public SDLK_WWW (scancode->keycode SDL_SCANCODE_WWW))
864 (define-public SDLK_MAIL (scancode->keycode SDL_SCANCODE_MAIL))
865 (define-public SDLK_CALCULATOR (scancode->keycode SDL_SCANCODE_CALCULATOR))
866 (define-public SDLK_COMPUTER (scancode->keycode SDL_SCANCODE_COMPUTER))
867 (define-public SDLK_AC_SEARCH (scancode->keycode SDL_SCANCODE_AC_SEARCH))
868 (define-public SDLK_AC_HOME (scancode->keycode SDL_SCANCODE_AC_HOME))
869 (define-public SDLK_AC_BACK (scancode->keycode SDL_SCANCODE_AC_BACK))
870 (define-public SDLK_AC_FORWARD (scancode->keycode SDL_SCANCODE_AC_FORWARD))
871 (define-public SDLK_AC_STOP (scancode->keycode SDL_SCANCODE_AC_STOP))
872 (define-public SDLK_AC_REFRESH (scancode->keycode SDL_SCANCODE_AC_REFRESH))
873 (define-public SDLK_AC_BOOKMARKS (scancode->keycode SDL_SCANCODE_AC_BOOKMARKS))
874 (define-public SDLK_BRIGHTNESSDOWN
875 (scancode->keycode SDL_SCANCODE_BRIGHTNESSDOWN))
876 (define-public SDLK_BRIGHTNESSUP (scancode->keycode SDL_SCANCODE_BRIGHTNESSUP))
877 (define-public SDLK_DISPLAYSWITCH (scancode->keycode SDL_SCANCODE_DISPLAYSWITCH))
878 (define-public SDLK_KBDILLUMTOGGLE
879 (scancode->keycode SDL_SCANCODE_KBDILLUMTOGGLE))
880 (define-public SDLK_KBDILLUMDOWN (scancode->keycode SDL_SCANCODE_KBDILLUMDOWN))
881 (define-public SDLK_KBDILLUMUP (scancode->keycode SDL_SCANCODE_KBDILLUMUP))
882 (define-public SDLK_EJECT (scancode->keycode SDL_SCANCODE_EJECT))
883 (define-public SDLK_SLEEP (scancode->keycode SDL_SCANCODE_SLEEP))
884
885 (define-foreign sdl-get-keyboard-state
886 '* "SDL_GetKeyboardState" '(*))
887
888 \f
889 ;;;
890 ;;; Text Input
891 ;;;
892
893 (define-foreign sdl-start-text-input
894 void "SDL_StartTextInput" '())
895
896 (define-foreign sdl-stop-text-input
897 void "SDL_StopTextInput" '())
898
899 (define-foreign sdl-is-text-input-active
900 sdl-bool "SDL_IsTextInputActive" '())
901
902 \f
903 ;;;
904 ;;; Mouse
905 ;;;
906
907 (define-public SDL_BUTTON_LEFT 1)
908 (define-public SDL_BUTTON_MIDDLE 2)
909 (define-public SDL_BUTTON_RIGHT 3)
910 (define-public SDL_BUTTON_X1 4)
911 (define-public SDL_BUTTON_X2 5)
912
913 (define (button-mask n)
914 (ash 1 (1- n)))
915
916 (define-public SDL_BUTTON_LMASK (button-mask SDL_BUTTON_LEFT))
917 (define-public SDL_BUTTON_MMASK (button-mask SDL_BUTTON_MIDDLE))
918 (define-public SDL_BUTTON_RMASK (button-mask SDL_BUTTON_RIGHT))
919 (define-public SDL_BUTTON_X1MASK (button-mask SDL_BUTTON_X1))
920 (define-public SDL_BUTTON_X2MASK (button-mask SDL_BUTTON_X2))
921
922 (define-foreign sdl-get-mouse-state
923 uint32 "SDL_GetMouseState" '(* *))
924
925 \f
926 ;;;
927 ;;; Timer
928 ;;;
929
930 (define-foreign sdl-get-ticks
931 uint32 "SDL_GetTicks" '())
932
933 \f
934 ;;;
935 ;;; File I/O
936 ;;;
937
938 (define-foreign sdl-rw-from-file
939 '* "SDL_RWFromFile" (list '* '*))
940
941 \f
942 ;;;
943 ;;; Pixels
944 ;;;
945
946 (define-public SDL_PIXELFORMAT_UNKNOWN 0)
947 (define-public SDL_PIXELFORMAT_INDEX1LSB 286261504)
948 (define-public SDL_PIXELFORMAT_INDEX1MSB 287310080)
949 (define-public SDL_PIXELFORMAT_INDEX4LSB 303039488)
950 (define-public SDL_PIXELFORMAT_INDEX4MSB 304088064)
951 (define-public SDL_PIXELFORMAT_INDEX8 318769153)
952 (define-public SDL_PIXELFORMAT_RGB332 336660481)
953 (define-public SDL_PIXELFORMAT_RGB444 353504258)
954 (define-public SDL_PIXELFORMAT_RGB555 353570562)
955 (define-public SDL_PIXELFORMAT_BGR555 357764866)
956 (define-public SDL_PIXELFORMAT_ARGB4444 355602434)
957 (define-public SDL_PIXELFORMAT_RGBA4444 356651010)
958 (define-public SDL_PIXELFORMAT_ABGR4444 359796738)
959 (define-public SDL_PIXELFORMAT_BGRA4444 360845314)
960 (define-public SDL_PIXELFORMAT_ARGB1555 355667970)
961 (define-public SDL_PIXELFORMAT_RGBA5551 356782082)
962 (define-public SDL_PIXELFORMAT_ABGR1555 359862274)
963 (define-public SDL_PIXELFORMAT_BGRA5551 360976386)
964 (define-public SDL_PIXELFORMAT_RGB565 353701890)
965 (define-public SDL_PIXELFORMAT_BGR565 357896194)
966 (define-public SDL_PIXELFORMAT_RGB24 386930691)
967 (define-public SDL_PIXELFORMAT_BGR24 390076419)
968 (define-public SDL_PIXELFORMAT_RGB888 370546692)
969 (define-public SDL_PIXELFORMAT_RGBX8888 371595268)
970 (define-public SDL_PIXELFORMAT_BGR888 374740996)
971 (define-public SDL_PIXELFORMAT_BGRX8888 375789572)
972 (define-public SDL_PIXELFORMAT_ARGB8888 372645892)
973 (define-public SDL_PIXELFORMAT_RGBA8888 373694468)
974 (define-public SDL_PIXELFORMAT_ABGR8888 376840196)
975 (define-public SDL_PIXELFORMAT_BGRA8888 377888772)
976 (define-public SDL_PIXELFORMAT_ARGB2101010 372711428)
977 (define-public SDL_PIXELFORMAT_YV12 842094169)
978 (define-public SDL_PIXELFORMAT_IYUV 1448433993)
979 (define-public SDL_PIXELFORMAT_YUY2 844715353)
980 (define-public SDL_PIXELFORMAT_UYVY 1498831189)
981 (define-public SDL_PIXELFORMAT_YVYU 1431918169)
982
983 \f
984 ;;;
985 ;;; Surface
986 ;;;
987
988 (define-foreign sdl-create-rgb-surface
989 '* "SDL_CreateRGBSurface"
990 (list uint32 int int int uint32 uint32 uint32 uint32))
991
992 (define-foreign sdl-create-rgb-surface-from
993 '* "SDL_CreateRGBSurfaceFrom"
994 (list '* int int int int uint32 uint32 uint32 uint32))
995
996 (define-foreign sdl-free-surface
997 void "SDL_FreeSurface" '(*))
998
999 (define-foreign sdl-load-bmp-rw
1000 '* "SDL_LoadBMP_RW" (list '* int))
1001
1002 (define-foreign sdl-convert-surface-format
1003 '* "SDL_ConvertSurfaceFormat" (list '* uint32 uint32))
1004
1005 (define-foreign sdl-blit-surface
1006 int "SDL_UpperBlit" '(* * * *))
1007
1008 (define-foreign sdl-blit-scaled
1009 int "SDL_UpperBlitScaled" '(* * * *))
1010
1011 (define-foreign sdl-fill-rect
1012 int "SDL_FillRect" (list '* '* uint32))
1013
1014 \f
1015 ;;;
1016 ;;; Audio
1017 ;;;
1018
1019 (define-public AUDIO_U8 #x0008)
1020 (define-public AUDIO_S8 #x8008)
1021 (define-public AUDIO_U16LSB #x0010)
1022 (define-public AUDIO_S16LSB #x8010)
1023 (define-public AUDIO_U16MSB #x1010)
1024 (define-public AUDIO_S16MSB #x9010)
1025 (define-public AUDIO_U16 AUDIO_U16LSB)
1026 (define-public AUDIO_S16 AUDIO_S16LSB)
1027 (define-public AUDIO_S32LSB #x8020)
1028 (define-public AUDIO_S32MSB #x9020)
1029 (define-public AUDIO_S32 AUDIO_S32LSB)
1030 (define-public AUDIO_F32LSB #x8120)
1031 (define-public AUDIO_F32MSB #x9120)
1032 (define-public AUDIO_F32 AUDIO_F32LSB)
1033
1034 \f
1035 ;;;
1036 ;;; Joystick
1037 ;;;
1038
1039 (define-public SDL_JOYSTICK_POWER_UNKNOWN -1)
1040 (define-public SDL_JOYSTICK_POWER_EMPTY 0)
1041 (define-public SDL_JOYSTICK_POWER_LOW 1)
1042 (define-public SDL_JOYSTICK_POWER_MEDIUM 2)
1043 (define-public SDL_JOYSTICK_POWER_FULL 3)
1044 (define-public SDL_JOYSTICK_POWER_WIRED 4)
1045 (define-public SDL_JOYSTICK_POWER_MAX 5)
1046
1047 (define-foreign sdl-joystick-open
1048 '* "SDL_JoystickOpen" (list int))
1049
1050 (define-foreign sdl-joystick-close
1051 void "SDL_JoystickClose" '(*))
1052
1053 (define-foreign sdl-joystick-current-power-level
1054 int "SDL_JoystickCurrentPowerLevel" '(*))
1055
1056 (define-foreign sdl-joystick-event-state
1057 int "SDL_JoystickEventState" (list int))
1058
1059 (define-foreign sdl-joystick-from-instance-id
1060 '* "SDL_JoystickFromInstanceID" (list int32))
1061
1062 (define-foreign sdl-joystick-get-attached
1063 sdl-bool "SDL_JoystickGetAttached" '(*))
1064
1065 (define-foreign sdl-joystick-get-axis
1066 int16 "SDL_JoystickGetAxis" (list '* int))
1067
1068 (define-foreign sdl-joystick-get-ball
1069 int "SDL_JoystickGetBall" (list '* int '* '*))
1070
1071 (define-foreign sdl-joystick-get-button
1072 uint8 "SDL_JoystickGetButton" (list '* int))
1073
1074 (define-foreign sdl-joystick-get-device-guid
1075 '* "SDL_JoystickGetDeviceGUID" (list int))
1076
1077 (define-foreign sdl-joystick-get-guid
1078 '* "SDL_JoystickGetGUID" (list int))
1079
1080 (define-foreign sdl-joystick-get-guid-from-string
1081 '* "SDL_JoystickGetGUIDFromString" '(*))
1082
1083 (define-foreign sdl-joystick-get-guid-string
1084 void "SDL_JoystickGetGUIDString" (list '* '* int))
1085
1086 (define-foreign sdl-joystick-get-hat
1087 uint8 "SDL_JoystickGetHat" (list '* int))
1088
1089 (define-foreign sdl-joystick-instance-id
1090 int32 "SDL_JoystickInstanceID" '(*))
1091
1092 (define-foreign sdl-joystick-name
1093 '* "SDL_JoystickName" '(*))
1094
1095 (define-foreign sdl-joystick-name-for-index
1096 '* "SDL_JoystickNameForIndex" (list int))
1097
1098 (define-foreign sdl-joystick-num-axes
1099 int "SDL_JoystickNumAxes" '(*))
1100
1101 (define-foreign sdl-joystick-num-balls
1102 int "SDL_JoystickNumBalls" '(*))
1103
1104 (define-foreign sdl-joystick-num-buttons
1105 int "SDL_JoystickNumButtons" '(*))
1106
1107 (define-foreign sdl-joystick-num-hats
1108 int "SDL_JoystickNumHats" '(*))
1109
1110 (define-foreign sdl-num-joysticks
1111 int "SDL_NumJoysticks" '())
1112
1113 (define-foreign sdl-joystick-update
1114 void "SDL_JoystickUpdate" '())
1115
1116 \f
1117 ;;;
1118 ;;; Game Controllers
1119 ;;;
1120
1121 (define-public SDL_CONTROLLER_AXIS_INVALID -1)
1122 (define-public SDL_CONTROLLER_AXIS_LEFTX 0)
1123 (define-public SDL_CONTROLLER_AXIS_LEFTY 1)
1124 (define-public SDL_CONTROLLER_AXIS_RIGHTX 2)
1125 (define-public SDL_CONTROLLER_AXIS_RIGHTY 3)
1126 (define-public SDL_CONTROLLER_AXIS_TRIGGERLEFT 4)
1127 (define-public SDL_CONTROLLER_AXIS_TRIGGERRIGHT 5)
1128 (define-public SDL_CONTROLLER_AXIS_MAX 6)
1129
1130 (define-public SDL_CONTROLLER_BUTTON_INVALID -1)
1131 (define-public SDL_CONTROLLER_BUTTON_A 0)
1132 (define-public SDL_CONTROLLER_BUTTON_B 1)
1133 (define-public SDL_CONTROLLER_BUTTON_X 2)
1134 (define-public SDL_CONTROLLER_BUTTON_Y 3)
1135 (define-public SDL_CONTROLLER_BUTTON_BACK 4)
1136 (define-public SDL_CONTROLLER_BUTTON_GUIDE 5)
1137 (define-public SDL_CONTROLLER_BUTTON_START 6)
1138 (define-public SDL_CONTROLLER_BUTTON_LEFTSTICK 7)
1139 (define-public SDL_CONTROLLER_BUTTON_RIGHTSTICK 8)
1140 (define-public SDL_CONTROLLER_BUTTON_LEFTSHOULDER 9)
1141 (define-public SDL_CONTROLLER_BUTTON_RIGHTSHOULDER 10)
1142 (define-public SDL_CONTROLLER_BUTTON_DPAD_UP 11)
1143 (define-public SDL_CONTROLLER_BUTTON_DPAD_DOWN 12)
1144 (define-public SDL_CONTROLLER_BUTTON_DPAD_LEFT 13)
1145 (define-public SDL_CONTROLLER_BUTTON_DPAD_RIGHT 14)
1146 (define-public SDL_CONTROLLER_BUTTON_MAX 15)
1147
1148 (define-foreign sdl-game-controller-add-mappings-from-rw
1149 int "SDL_GameControllerAddMappingsFromRW" (list '* int))
1150
1151 (define-foreign sdl-game-controller-add-mapping
1152 int "SDL_GameControllerAddMapping" '(*))
1153
1154 (define-foreign sdl-game-controller-open
1155 '* "SDL_GameControllerOpen" (list int))
1156
1157 (define-foreign sdl-game-controller-close
1158 void "SDL_GameControllerClose" '(*))
1159
1160 (define-foreign sdl-game-controller-event-state
1161 int "SDL_GameControllerEventState" (list int))
1162
1163 (define-foreign sdl-game-controller-from-instance-id
1164 '* "SDL_GameControllerFromInstanceID" (list int32))
1165
1166 (define-foreign sdl-game-controller-get-attached
1167 sdl-bool "SDL_GameControllerGetAttached" '(*))
1168
1169 (define-foreign sdl-game-controller-get-axis
1170 int16 "SDL_GameControllerGetAxis" (list '* int))
1171
1172 (define-foreign sdl-game-controller-get-axis-from-string
1173 int "SDL_GameControllerGetAxisFromString" '(*))
1174
1175 (define-foreign sdl-game-controller-get-string-for-axis
1176 '* "SDL_GameControllerGetStringForAxis" (list int))
1177
1178 (define-foreign sdl-game-controller-get-button
1179 uint8 "SDL_GameControllerGetButton" (list '* int))
1180
1181 (define-foreign sdl-game-controller-get-button-from-string
1182 int "SDL_GameControllerGetButtonFromString" '(*))
1183
1184 (define-foreign sdl-game-controller-get-string-for-button
1185 '* "SDL_GameControllerGetStringForButton" (list int))
1186
1187 (define-foreign sdl-game-controller-get-joystick
1188 '* "SDL_GameControllerGetJoystick" '(*))
1189
1190 (define-foreign sdl-game-controller-mapping
1191 '* "SDL_GameControllerMapping" '(*))
1192
1193 (define-foreign sdl-game-controller-mapping-for-guid
1194 '* "SDL_GameControllerMappingForGUID" '(*))
1195
1196 (define-foreign sdl-game-controller-name
1197 '* "SDL_GameControllerName" '(*))
1198
1199 (define-foreign sdl-game-controller-name-for-index
1200 '* "SDL_GameControllerNameForIndex" (list int))
1201
1202 (define-foreign sdl-game-controller-update
1203 void "SDL_GameControllerUpdate" '())
1204
1205 (define-foreign sdl-is-game-controller
1206 sdl-bool "SDL_IsGameController" (list int))
1207
1208 \f
1209 ;;;
1210 ;;; Clipboard
1211 ;;;
1212
1213 (define-foreign sdl-get-clipboard-text
1214 '* "SDL_GetClipboardText" '())
1215
1216 (define-foreign sdl-set-clipboard-text
1217 int "SDL_SetClipboardText" '(*))
1218
1219 (define-foreign sdl-has-clipboard-text
1220 int "SDL_HasClipboardText" '())