sdl2-bindings 0.1.0 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog +134 -108
  3. data/LICENSE.txt +0 -0
  4. data/README.md +86 -68
  5. data/lib/sdl2.rb +131 -127
  6. data/lib/sdl2_audio.rb +261 -261
  7. data/lib/sdl2_blendmode.rb +72 -72
  8. data/lib/sdl2_clipboard.rb +56 -56
  9. data/lib/sdl2_cpuinfo.rb +129 -129
  10. data/lib/sdl2_error.rb +71 -71
  11. data/lib/sdl2_events.rb +564 -552
  12. data/lib/sdl2_filesystem.rb +52 -52
  13. data/lib/sdl2_framerate.rb +74 -74
  14. data/lib/sdl2_gamecontroller.rb +329 -329
  15. data/lib/sdl2_gesture.rb +61 -61
  16. data/lib/sdl2_gfxPrimitives.rb +283 -283
  17. data/lib/sdl2_haptic.rb +301 -301
  18. data/lib/sdl2_hidapi.rb +139 -139
  19. data/lib/sdl2_hints.rb +221 -207
  20. data/lib/sdl2_image.rb +296 -232
  21. data/lib/sdl2_imageFilter.rb +164 -164
  22. data/lib/sdl2_joystick.rb +294 -294
  23. data/lib/sdl2_keyboard.rb +125 -117
  24. data/lib/sdl2_keycode.rb +307 -307
  25. data/lib/sdl2_log.rb +131 -131
  26. data/lib/sdl2_main.rb +74 -74
  27. data/lib/sdl2_messagebox.rb +102 -102
  28. data/lib/sdl2_misc.rb +48 -48
  29. data/lib/sdl2_mixer.rb +464 -392
  30. data/lib/sdl2_mouse.rb +136 -136
  31. data/lib/sdl2_pixels.rb +240 -240
  32. data/lib/sdl2_platform.rb +48 -48
  33. data/lib/sdl2_power.rb +54 -54
  34. data/lib/sdl2_rect.rb +145 -109
  35. data/lib/sdl2_render.rb +408 -404
  36. data/lib/sdl2_rotozoom.rb +76 -76
  37. data/lib/sdl2_rwops.rb +242 -238
  38. data/lib/sdl2_scancode.rb +289 -289
  39. data/lib/sdl2_sensor.rb +115 -115
  40. data/lib/sdl2_shape.rb +83 -83
  41. data/lib/sdl2_sound.rb +154 -0
  42. data/lib/sdl2_stdinc.rb +548 -564
  43. data/lib/sdl2_surface.rb +229 -229
  44. data/lib/sdl2_syswm.rb +160 -160
  45. data/lib/sdl2_timer.rb +74 -74
  46. data/lib/sdl2_touch.rb +86 -82
  47. data/lib/sdl2_ttf.rb +414 -357
  48. data/lib/sdl2_version.rb +67 -67
  49. data/lib/sdl2_video.rb +540 -540
  50. data/lib/sdl2_vulkan.rb +72 -72
  51. metadata +3 -2
data/lib/sdl2_keycode.rb CHANGED
@@ -1,307 +1,307 @@
1
- # Ruby-SDL2 : Yet another SDL2 wrapper for Ruby
2
- #
3
- # * https://github.com/vaiorabbit/sdl2-bindings
4
- #
5
- # [NOTICE] This is an automatically generated file.
6
-
7
- require 'ffi'
8
-
9
- module SDL
10
- extend FFI::Library
11
- # Define/Macro
12
-
13
-
14
- # Enum
15
-
16
- SDLK_UNKNOWN = 0
17
- SDLK_RETURN = 13
18
- SDLK_ESCAPE = 27
19
- SDLK_BACKSPACE = 8
20
- SDLK_TAB = 9
21
- SDLK_SPACE = 32
22
- SDLK_EXCLAIM = 33
23
- SDLK_QUOTEDBL = 34
24
- SDLK_HASH = 35
25
- SDLK_PERCENT = 37
26
- SDLK_DOLLAR = 36
27
- SDLK_AMPERSAND = 38
28
- SDLK_QUOTE = 39
29
- SDLK_LEFTPAREN = 40
30
- SDLK_RIGHTPAREN = 41
31
- SDLK_ASTERISK = 42
32
- SDLK_PLUS = 43
33
- SDLK_COMMA = 44
34
- SDLK_MINUS = 45
35
- SDLK_PERIOD = 46
36
- SDLK_SLASH = 47
37
- SDLK_0 = 48
38
- SDLK_1 = 49
39
- SDLK_2 = 50
40
- SDLK_3 = 51
41
- SDLK_4 = 52
42
- SDLK_5 = 53
43
- SDLK_6 = 54
44
- SDLK_7 = 55
45
- SDLK_8 = 56
46
- SDLK_9 = 57
47
- SDLK_COLON = 58
48
- SDLK_SEMICOLON = 59
49
- SDLK_LESS = 60
50
- SDLK_EQUALS = 61
51
- SDLK_GREATER = 62
52
- SDLK_QUESTION = 63
53
- SDLK_AT = 64
54
- SDLK_LEFTBRACKET = 91
55
- SDLK_BACKSLASH = 92
56
- SDLK_RIGHTBRACKET = 93
57
- SDLK_CARET = 94
58
- SDLK_UNDERSCORE = 95
59
- SDLK_BACKQUOTE = 96
60
- SDLK_a = 97
61
- SDLK_b = 98
62
- SDLK_c = 99
63
- SDLK_d = 100
64
- SDLK_e = 101
65
- SDLK_f = 102
66
- SDLK_g = 103
67
- SDLK_h = 104
68
- SDLK_i = 105
69
- SDLK_j = 106
70
- SDLK_k = 107
71
- SDLK_l = 108
72
- SDLK_m = 109
73
- SDLK_n = 110
74
- SDLK_o = 111
75
- SDLK_p = 112
76
- SDLK_q = 113
77
- SDLK_r = 114
78
- SDLK_s = 115
79
- SDLK_t = 116
80
- SDLK_u = 117
81
- SDLK_v = 118
82
- SDLK_w = 119
83
- SDLK_x = 120
84
- SDLK_y = 121
85
- SDLK_z = 122
86
- SDLK_CAPSLOCK = 1073741881
87
- SDLK_F1 = 1073741882
88
- SDLK_F2 = 1073741883
89
- SDLK_F3 = 1073741884
90
- SDLK_F4 = 1073741885
91
- SDLK_F5 = 1073741886
92
- SDLK_F6 = 1073741887
93
- SDLK_F7 = 1073741888
94
- SDLK_F8 = 1073741889
95
- SDLK_F9 = 1073741890
96
- SDLK_F10 = 1073741891
97
- SDLK_F11 = 1073741892
98
- SDLK_F12 = 1073741893
99
- SDLK_PRINTSCREEN = 1073741894
100
- SDLK_SCROLLLOCK = 1073741895
101
- SDLK_PAUSE = 1073741896
102
- SDLK_INSERT = 1073741897
103
- SDLK_HOME = 1073741898
104
- SDLK_PAGEUP = 1073741899
105
- SDLK_DELETE = 127
106
- SDLK_END = 1073741901
107
- SDLK_PAGEDOWN = 1073741902
108
- SDLK_RIGHT = 1073741903
109
- SDLK_LEFT = 1073741904
110
- SDLK_DOWN = 1073741905
111
- SDLK_UP = 1073741906
112
- SDLK_NUMLOCKCLEAR = 1073741907
113
- SDLK_KP_DIVIDE = 1073741908
114
- SDLK_KP_MULTIPLY = 1073741909
115
- SDLK_KP_MINUS = 1073741910
116
- SDLK_KP_PLUS = 1073741911
117
- SDLK_KP_ENTER = 1073741912
118
- SDLK_KP_1 = 1073741913
119
- SDLK_KP_2 = 1073741914
120
- SDLK_KP_3 = 1073741915
121
- SDLK_KP_4 = 1073741916
122
- SDLK_KP_5 = 1073741917
123
- SDLK_KP_6 = 1073741918
124
- SDLK_KP_7 = 1073741919
125
- SDLK_KP_8 = 1073741920
126
- SDLK_KP_9 = 1073741921
127
- SDLK_KP_0 = 1073741922
128
- SDLK_KP_PERIOD = 1073741923
129
- SDLK_APPLICATION = 1073741925
130
- SDLK_POWER = 1073741926
131
- SDLK_KP_EQUALS = 1073741927
132
- SDLK_F13 = 1073741928
133
- SDLK_F14 = 1073741929
134
- SDLK_F15 = 1073741930
135
- SDLK_F16 = 1073741931
136
- SDLK_F17 = 1073741932
137
- SDLK_F18 = 1073741933
138
- SDLK_F19 = 1073741934
139
- SDLK_F20 = 1073741935
140
- SDLK_F21 = 1073741936
141
- SDLK_F22 = 1073741937
142
- SDLK_F23 = 1073741938
143
- SDLK_F24 = 1073741939
144
- SDLK_EXECUTE = 1073741940
145
- SDLK_HELP = 1073741941
146
- SDLK_MENU = 1073741942
147
- SDLK_SELECT = 1073741943
148
- SDLK_STOP = 1073741944
149
- SDLK_AGAIN = 1073741945
150
- SDLK_UNDO = 1073741946
151
- SDLK_CUT = 1073741947
152
- SDLK_COPY = 1073741948
153
- SDLK_PASTE = 1073741949
154
- SDLK_FIND = 1073741950
155
- SDLK_MUTE = 1073741951
156
- SDLK_VOLUMEUP = 1073741952
157
- SDLK_VOLUMEDOWN = 1073741953
158
- SDLK_KP_COMMA = 1073741957
159
- SDLK_KP_EQUALSAS400 = 1073741958
160
- SDLK_ALTERASE = 1073741977
161
- SDLK_SYSREQ = 1073741978
162
- SDLK_CANCEL = 1073741979
163
- SDLK_CLEAR = 1073741980
164
- SDLK_PRIOR = 1073741981
165
- SDLK_RETURN2 = 1073741982
166
- SDLK_SEPARATOR = 1073741983
167
- SDLK_OUT = 1073741984
168
- SDLK_OPER = 1073741985
169
- SDLK_CLEARAGAIN = 1073741986
170
- SDLK_CRSEL = 1073741987
171
- SDLK_EXSEL = 1073741988
172
- SDLK_KP_00 = 1073742000
173
- SDLK_KP_000 = 1073742001
174
- SDLK_THOUSANDSSEPARATOR = 1073742002
175
- SDLK_DECIMALSEPARATOR = 1073742003
176
- SDLK_CURRENCYUNIT = 1073742004
177
- SDLK_CURRENCYSUBUNIT = 1073742005
178
- SDLK_KP_LEFTPAREN = 1073742006
179
- SDLK_KP_RIGHTPAREN = 1073742007
180
- SDLK_KP_LEFTBRACE = 1073742008
181
- SDLK_KP_RIGHTBRACE = 1073742009
182
- SDLK_KP_TAB = 1073742010
183
- SDLK_KP_BACKSPACE = 1073742011
184
- SDLK_KP_A = 1073742012
185
- SDLK_KP_B = 1073742013
186
- SDLK_KP_C = 1073742014
187
- SDLK_KP_D = 1073742015
188
- SDLK_KP_E = 1073742016
189
- SDLK_KP_F = 1073742017
190
- SDLK_KP_XOR = 1073742018
191
- SDLK_KP_POWER = 1073742019
192
- SDLK_KP_PERCENT = 1073742020
193
- SDLK_KP_LESS = 1073742021
194
- SDLK_KP_GREATER = 1073742022
195
- SDLK_KP_AMPERSAND = 1073742023
196
- SDLK_KP_DBLAMPERSAND = 1073742024
197
- SDLK_KP_VERTICALBAR = 1073742025
198
- SDLK_KP_DBLVERTICALBAR = 1073742026
199
- SDLK_KP_COLON = 1073742027
200
- SDLK_KP_HASH = 1073742028
201
- SDLK_KP_SPACE = 1073742029
202
- SDLK_KP_AT = 1073742030
203
- SDLK_KP_EXCLAM = 1073742031
204
- SDLK_KP_MEMSTORE = 1073742032
205
- SDLK_KP_MEMRECALL = 1073742033
206
- SDLK_KP_MEMCLEAR = 1073742034
207
- SDLK_KP_MEMADD = 1073742035
208
- SDLK_KP_MEMSUBTRACT = 1073742036
209
- SDLK_KP_MEMMULTIPLY = 1073742037
210
- SDLK_KP_MEMDIVIDE = 1073742038
211
- SDLK_KP_PLUSMINUS = 1073742039
212
- SDLK_KP_CLEAR = 1073742040
213
- SDLK_KP_CLEARENTRY = 1073742041
214
- SDLK_KP_BINARY = 1073742042
215
- SDLK_KP_OCTAL = 1073742043
216
- SDLK_KP_DECIMAL = 1073742044
217
- SDLK_KP_HEXADECIMAL = 1073742045
218
- SDLK_LCTRL = 1073742048
219
- SDLK_LSHIFT = 1073742049
220
- SDLK_LALT = 1073742050
221
- SDLK_LGUI = 1073742051
222
- SDLK_RCTRL = 1073742052
223
- SDLK_RSHIFT = 1073742053
224
- SDLK_RALT = 1073742054
225
- SDLK_RGUI = 1073742055
226
- SDLK_MODE = 1073742081
227
- SDLK_AUDIONEXT = 1073742082
228
- SDLK_AUDIOPREV = 1073742083
229
- SDLK_AUDIOSTOP = 1073742084
230
- SDLK_AUDIOPLAY = 1073742085
231
- SDLK_AUDIOMUTE = 1073742086
232
- SDLK_MEDIASELECT = 1073742087
233
- SDLK_WWW = 1073742088
234
- SDLK_MAIL = 1073742089
235
- SDLK_CALCULATOR = 1073742090
236
- SDLK_COMPUTER = 1073742091
237
- SDLK_AC_SEARCH = 1073742092
238
- SDLK_AC_HOME = 1073742093
239
- SDLK_AC_BACK = 1073742094
240
- SDLK_AC_FORWARD = 1073742095
241
- SDLK_AC_STOP = 1073742096
242
- SDLK_AC_REFRESH = 1073742097
243
- SDLK_AC_BOOKMARKS = 1073742098
244
- SDLK_BRIGHTNESSDOWN = 1073742099
245
- SDLK_BRIGHTNESSUP = 1073742100
246
- SDLK_DISPLAYSWITCH = 1073742101
247
- SDLK_KBDILLUMTOGGLE = 1073742102
248
- SDLK_KBDILLUMDOWN = 1073742103
249
- SDLK_KBDILLUMUP = 1073742104
250
- SDLK_EJECT = 1073742105
251
- SDLK_SLEEP = 1073742106
252
- SDLK_APP1 = 1073742107
253
- SDLK_APP2 = 1073742108
254
- SDLK_AUDIOREWIND = 1073742109
255
- SDLK_AUDIOFASTFORWARD = 1073742110
256
- KMOD_NONE = 0
257
- KMOD_LSHIFT = 1
258
- KMOD_RSHIFT = 2
259
- KMOD_LCTRL = 64
260
- KMOD_RCTRL = 128
261
- KMOD_LALT = 256
262
- KMOD_RALT = 512
263
- KMOD_LGUI = 1024
264
- KMOD_RGUI = 2048
265
- KMOD_NUM = 4096
266
- KMOD_CAPS = 8192
267
- KMOD_MODE = 16384
268
- KMOD_SCROLL = 32768
269
- KMOD_CTRL = 192
270
- KMOD_SHIFT = 3
271
- KMOD_ALT = 768
272
- KMOD_GUI = 3072
273
- KMOD_RESERVED = 32768
274
-
275
- # Typedef
276
-
277
- typedef :int, :SDL_Keycode
278
- typedef :int, :SDL_KeyCode
279
- typedef :int, :SDL_Keymod
280
-
281
- # Struct
282
-
283
-
284
- # Function
285
-
286
- def self.setup_keycode_symbols(output_error = false)
287
- symbols = [
288
- ]
289
- apis = {
290
- }
291
- args = {
292
- }
293
- retvals = {
294
- }
295
- symbols.each do |sym|
296
- begin
297
- attach_function apis[sym], sym, args[sym], retvals[sym]
298
- rescue FFI::NotFoundError => error
299
- $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
300
- end
301
- end
302
- end
303
-
304
- end
305
-
306
- # TODO #define KMOD_CTRL, #define KMOD_SHIFT, #define KMOD_ALT and #define KMOD_GUI
307
-
1
+ # Ruby-SDL2 : Yet another SDL2 wrapper for Ruby
2
+ #
3
+ # * https://github.com/vaiorabbit/sdl2-bindings
4
+ #
5
+ # [NOTICE] This is an automatically generated file.
6
+
7
+ require 'ffi'
8
+
9
+ module SDL
10
+ extend FFI::Library
11
+ # Define/Macro
12
+
13
+
14
+ # Enum
15
+
16
+ SDLK_UNKNOWN = 0
17
+ SDLK_RETURN = 13
18
+ SDLK_ESCAPE = 27
19
+ SDLK_BACKSPACE = 8
20
+ SDLK_TAB = 9
21
+ SDLK_SPACE = 32
22
+ SDLK_EXCLAIM = 33
23
+ SDLK_QUOTEDBL = 34
24
+ SDLK_HASH = 35
25
+ SDLK_PERCENT = 37
26
+ SDLK_DOLLAR = 36
27
+ SDLK_AMPERSAND = 38
28
+ SDLK_QUOTE = 39
29
+ SDLK_LEFTPAREN = 40
30
+ SDLK_RIGHTPAREN = 41
31
+ SDLK_ASTERISK = 42
32
+ SDLK_PLUS = 43
33
+ SDLK_COMMA = 44
34
+ SDLK_MINUS = 45
35
+ SDLK_PERIOD = 46
36
+ SDLK_SLASH = 47
37
+ SDLK_0 = 48
38
+ SDLK_1 = 49
39
+ SDLK_2 = 50
40
+ SDLK_3 = 51
41
+ SDLK_4 = 52
42
+ SDLK_5 = 53
43
+ SDLK_6 = 54
44
+ SDLK_7 = 55
45
+ SDLK_8 = 56
46
+ SDLK_9 = 57
47
+ SDLK_COLON = 58
48
+ SDLK_SEMICOLON = 59
49
+ SDLK_LESS = 60
50
+ SDLK_EQUALS = 61
51
+ SDLK_GREATER = 62
52
+ SDLK_QUESTION = 63
53
+ SDLK_AT = 64
54
+ SDLK_LEFTBRACKET = 91
55
+ SDLK_BACKSLASH = 92
56
+ SDLK_RIGHTBRACKET = 93
57
+ SDLK_CARET = 94
58
+ SDLK_UNDERSCORE = 95
59
+ SDLK_BACKQUOTE = 96
60
+ SDLK_a = 97
61
+ SDLK_b = 98
62
+ SDLK_c = 99
63
+ SDLK_d = 100
64
+ SDLK_e = 101
65
+ SDLK_f = 102
66
+ SDLK_g = 103
67
+ SDLK_h = 104
68
+ SDLK_i = 105
69
+ SDLK_j = 106
70
+ SDLK_k = 107
71
+ SDLK_l = 108
72
+ SDLK_m = 109
73
+ SDLK_n = 110
74
+ SDLK_o = 111
75
+ SDLK_p = 112
76
+ SDLK_q = 113
77
+ SDLK_r = 114
78
+ SDLK_s = 115
79
+ SDLK_t = 116
80
+ SDLK_u = 117
81
+ SDLK_v = 118
82
+ SDLK_w = 119
83
+ SDLK_x = 120
84
+ SDLK_y = 121
85
+ SDLK_z = 122
86
+ SDLK_CAPSLOCK = 1073741881
87
+ SDLK_F1 = 1073741882
88
+ SDLK_F2 = 1073741883
89
+ SDLK_F3 = 1073741884
90
+ SDLK_F4 = 1073741885
91
+ SDLK_F5 = 1073741886
92
+ SDLK_F6 = 1073741887
93
+ SDLK_F7 = 1073741888
94
+ SDLK_F8 = 1073741889
95
+ SDLK_F9 = 1073741890
96
+ SDLK_F10 = 1073741891
97
+ SDLK_F11 = 1073741892
98
+ SDLK_F12 = 1073741893
99
+ SDLK_PRINTSCREEN = 1073741894
100
+ SDLK_SCROLLLOCK = 1073741895
101
+ SDLK_PAUSE = 1073741896
102
+ SDLK_INSERT = 1073741897
103
+ SDLK_HOME = 1073741898
104
+ SDLK_PAGEUP = 1073741899
105
+ SDLK_DELETE = 127
106
+ SDLK_END = 1073741901
107
+ SDLK_PAGEDOWN = 1073741902
108
+ SDLK_RIGHT = 1073741903
109
+ SDLK_LEFT = 1073741904
110
+ SDLK_DOWN = 1073741905
111
+ SDLK_UP = 1073741906
112
+ SDLK_NUMLOCKCLEAR = 1073741907
113
+ SDLK_KP_DIVIDE = 1073741908
114
+ SDLK_KP_MULTIPLY = 1073741909
115
+ SDLK_KP_MINUS = 1073741910
116
+ SDLK_KP_PLUS = 1073741911
117
+ SDLK_KP_ENTER = 1073741912
118
+ SDLK_KP_1 = 1073741913
119
+ SDLK_KP_2 = 1073741914
120
+ SDLK_KP_3 = 1073741915
121
+ SDLK_KP_4 = 1073741916
122
+ SDLK_KP_5 = 1073741917
123
+ SDLK_KP_6 = 1073741918
124
+ SDLK_KP_7 = 1073741919
125
+ SDLK_KP_8 = 1073741920
126
+ SDLK_KP_9 = 1073741921
127
+ SDLK_KP_0 = 1073741922
128
+ SDLK_KP_PERIOD = 1073741923
129
+ SDLK_APPLICATION = 1073741925
130
+ SDLK_POWER = 1073741926
131
+ SDLK_KP_EQUALS = 1073741927
132
+ SDLK_F13 = 1073741928
133
+ SDLK_F14 = 1073741929
134
+ SDLK_F15 = 1073741930
135
+ SDLK_F16 = 1073741931
136
+ SDLK_F17 = 1073741932
137
+ SDLK_F18 = 1073741933
138
+ SDLK_F19 = 1073741934
139
+ SDLK_F20 = 1073741935
140
+ SDLK_F21 = 1073741936
141
+ SDLK_F22 = 1073741937
142
+ SDLK_F23 = 1073741938
143
+ SDLK_F24 = 1073741939
144
+ SDLK_EXECUTE = 1073741940
145
+ SDLK_HELP = 1073741941
146
+ SDLK_MENU = 1073741942
147
+ SDLK_SELECT = 1073741943
148
+ SDLK_STOP = 1073741944
149
+ SDLK_AGAIN = 1073741945
150
+ SDLK_UNDO = 1073741946
151
+ SDLK_CUT = 1073741947
152
+ SDLK_COPY = 1073741948
153
+ SDLK_PASTE = 1073741949
154
+ SDLK_FIND = 1073741950
155
+ SDLK_MUTE = 1073741951
156
+ SDLK_VOLUMEUP = 1073741952
157
+ SDLK_VOLUMEDOWN = 1073741953
158
+ SDLK_KP_COMMA = 1073741957
159
+ SDLK_KP_EQUALSAS400 = 1073741958
160
+ SDLK_ALTERASE = 1073741977
161
+ SDLK_SYSREQ = 1073741978
162
+ SDLK_CANCEL = 1073741979
163
+ SDLK_CLEAR = 1073741980
164
+ SDLK_PRIOR = 1073741981
165
+ SDLK_RETURN2 = 1073741982
166
+ SDLK_SEPARATOR = 1073741983
167
+ SDLK_OUT = 1073741984
168
+ SDLK_OPER = 1073741985
169
+ SDLK_CLEARAGAIN = 1073741986
170
+ SDLK_CRSEL = 1073741987
171
+ SDLK_EXSEL = 1073741988
172
+ SDLK_KP_00 = 1073742000
173
+ SDLK_KP_000 = 1073742001
174
+ SDLK_THOUSANDSSEPARATOR = 1073742002
175
+ SDLK_DECIMALSEPARATOR = 1073742003
176
+ SDLK_CURRENCYUNIT = 1073742004
177
+ SDLK_CURRENCYSUBUNIT = 1073742005
178
+ SDLK_KP_LEFTPAREN = 1073742006
179
+ SDLK_KP_RIGHTPAREN = 1073742007
180
+ SDLK_KP_LEFTBRACE = 1073742008
181
+ SDLK_KP_RIGHTBRACE = 1073742009
182
+ SDLK_KP_TAB = 1073742010
183
+ SDLK_KP_BACKSPACE = 1073742011
184
+ SDLK_KP_A = 1073742012
185
+ SDLK_KP_B = 1073742013
186
+ SDLK_KP_C = 1073742014
187
+ SDLK_KP_D = 1073742015
188
+ SDLK_KP_E = 1073742016
189
+ SDLK_KP_F = 1073742017
190
+ SDLK_KP_XOR = 1073742018
191
+ SDLK_KP_POWER = 1073742019
192
+ SDLK_KP_PERCENT = 1073742020
193
+ SDLK_KP_LESS = 1073742021
194
+ SDLK_KP_GREATER = 1073742022
195
+ SDLK_KP_AMPERSAND = 1073742023
196
+ SDLK_KP_DBLAMPERSAND = 1073742024
197
+ SDLK_KP_VERTICALBAR = 1073742025
198
+ SDLK_KP_DBLVERTICALBAR = 1073742026
199
+ SDLK_KP_COLON = 1073742027
200
+ SDLK_KP_HASH = 1073742028
201
+ SDLK_KP_SPACE = 1073742029
202
+ SDLK_KP_AT = 1073742030
203
+ SDLK_KP_EXCLAM = 1073742031
204
+ SDLK_KP_MEMSTORE = 1073742032
205
+ SDLK_KP_MEMRECALL = 1073742033
206
+ SDLK_KP_MEMCLEAR = 1073742034
207
+ SDLK_KP_MEMADD = 1073742035
208
+ SDLK_KP_MEMSUBTRACT = 1073742036
209
+ SDLK_KP_MEMMULTIPLY = 1073742037
210
+ SDLK_KP_MEMDIVIDE = 1073742038
211
+ SDLK_KP_PLUSMINUS = 1073742039
212
+ SDLK_KP_CLEAR = 1073742040
213
+ SDLK_KP_CLEARENTRY = 1073742041
214
+ SDLK_KP_BINARY = 1073742042
215
+ SDLK_KP_OCTAL = 1073742043
216
+ SDLK_KP_DECIMAL = 1073742044
217
+ SDLK_KP_HEXADECIMAL = 1073742045
218
+ SDLK_LCTRL = 1073742048
219
+ SDLK_LSHIFT = 1073742049
220
+ SDLK_LALT = 1073742050
221
+ SDLK_LGUI = 1073742051
222
+ SDLK_RCTRL = 1073742052
223
+ SDLK_RSHIFT = 1073742053
224
+ SDLK_RALT = 1073742054
225
+ SDLK_RGUI = 1073742055
226
+ SDLK_MODE = 1073742081
227
+ SDLK_AUDIONEXT = 1073742082
228
+ SDLK_AUDIOPREV = 1073742083
229
+ SDLK_AUDIOSTOP = 1073742084
230
+ SDLK_AUDIOPLAY = 1073742085
231
+ SDLK_AUDIOMUTE = 1073742086
232
+ SDLK_MEDIASELECT = 1073742087
233
+ SDLK_WWW = 1073742088
234
+ SDLK_MAIL = 1073742089
235
+ SDLK_CALCULATOR = 1073742090
236
+ SDLK_COMPUTER = 1073742091
237
+ SDLK_AC_SEARCH = 1073742092
238
+ SDLK_AC_HOME = 1073742093
239
+ SDLK_AC_BACK = 1073742094
240
+ SDLK_AC_FORWARD = 1073742095
241
+ SDLK_AC_STOP = 1073742096
242
+ SDLK_AC_REFRESH = 1073742097
243
+ SDLK_AC_BOOKMARKS = 1073742098
244
+ SDLK_BRIGHTNESSDOWN = 1073742099
245
+ SDLK_BRIGHTNESSUP = 1073742100
246
+ SDLK_DISPLAYSWITCH = 1073742101
247
+ SDLK_KBDILLUMTOGGLE = 1073742102
248
+ SDLK_KBDILLUMDOWN = 1073742103
249
+ SDLK_KBDILLUMUP = 1073742104
250
+ SDLK_EJECT = 1073742105
251
+ SDLK_SLEEP = 1073742106
252
+ SDLK_APP1 = 1073742107
253
+ SDLK_APP2 = 1073742108
254
+ SDLK_AUDIOREWIND = 1073742109
255
+ SDLK_AUDIOFASTFORWARD = 1073742110
256
+ KMOD_NONE = 0
257
+ KMOD_LSHIFT = 1
258
+ KMOD_RSHIFT = 2
259
+ KMOD_LCTRL = 64
260
+ KMOD_RCTRL = 128
261
+ KMOD_LALT = 256
262
+ KMOD_RALT = 512
263
+ KMOD_LGUI = 1024
264
+ KMOD_RGUI = 2048
265
+ KMOD_NUM = 4096
266
+ KMOD_CAPS = 8192
267
+ KMOD_MODE = 16384
268
+ KMOD_SCROLL = 32768
269
+ KMOD_CTRL = 192
270
+ KMOD_SHIFT = 3
271
+ KMOD_ALT = 768
272
+ KMOD_GUI = 3072
273
+ KMOD_RESERVED = 32768
274
+
275
+ # Typedef
276
+
277
+ typedef :int, :SDL_Keycode
278
+ typedef :int, :SDL_KeyCode
279
+ typedef :int, :SDL_Keymod
280
+
281
+ # Struct
282
+
283
+
284
+ # Function
285
+
286
+ def self.setup_keycode_symbols(output_error = false)
287
+ symbols = [
288
+ ]
289
+ apis = {
290
+ }
291
+ args = {
292
+ }
293
+ retvals = {
294
+ }
295
+ symbols.each do |sym|
296
+ begin
297
+ attach_function apis[sym], sym, args[sym], retvals[sym]
298
+ rescue FFI::NotFoundError => error
299
+ $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
300
+ end
301
+ end
302
+ end
303
+
304
+ end
305
+
306
+ # TODO #define KMOD_CTRL, #define KMOD_SHIFT, #define KMOD_ALT and #define KMOD_GUI
307
+