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