sdl2-win93 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. checksums.yaml +7 -0
  2. data/.dir-locals.el +2 -0
  3. data/.github/workflows/gempush.yml +29 -0
  4. data/.gitignore +14 -0
  5. data/COPYING.txt +165 -0
  6. data/Gemfile +4 -0
  7. data/Gemfile.lock +24 -0
  8. data/Makefile +4 -0
  9. data/README.md +36 -0
  10. data/Rakefile +51 -0
  11. data/doc/po/ja.po +10357 -0
  12. data/ext/sdl2_ext/clipboard.c +61 -0
  13. data/ext/sdl2_ext/color.c +103 -0
  14. data/ext/sdl2_ext/color.h +4 -0
  15. data/ext/sdl2_ext/event.c +1298 -0
  16. data/ext/sdl2_ext/extconf.rb +22 -0
  17. data/ext/sdl2_ext/filesystem.c +63 -0
  18. data/ext/sdl2_ext/gamecontroller.c +408 -0
  19. data/ext/sdl2_ext/gamecontroller.c.m4 +408 -0
  20. data/ext/sdl2_ext/gl.c +351 -0
  21. data/ext/sdl2_ext/gl.c.m4 +351 -0
  22. data/ext/sdl2_ext/hint.c +99 -0
  23. data/ext/sdl2_ext/joystick.c +339 -0
  24. data/ext/sdl2_ext/joystick.c.m4 +339 -0
  25. data/ext/sdl2_ext/key.c +1302 -0
  26. data/ext/sdl2_ext/key.c.m4 +833 -0
  27. data/ext/sdl2_ext/main.c +258 -0
  28. data/ext/sdl2_ext/messagebox.c +233 -0
  29. data/ext/sdl2_ext/mixer.c +1205 -0
  30. data/ext/sdl2_ext/mixer.c.m4 +1205 -0
  31. data/ext/sdl2_ext/mouse.c +286 -0
  32. data/ext/sdl2_ext/rubysdl2_internal.h +127 -0
  33. data/ext/sdl2_ext/timer.c +63 -0
  34. data/ext/sdl2_ext/ttf.c +376 -0
  35. data/ext/sdl2_ext/ttf.c.m4 +376 -0
  36. data/ext/sdl2_ext/video.c +4093 -0
  37. data/ext/sdl2_ext/video.c.m4 +3867 -0
  38. data/lib/sdl2.rb +3 -0
  39. data/lib/sdl2/event.rb +55 -0
  40. data/lib/sdl2/version.rb +8 -0
  41. data/sample/chunk_destroy.rb +16 -0
  42. data/sample/gfxprimitives.rb +54 -0
  43. data/sample/icon.bmp +0 -0
  44. data/sample/memory_test/m1.rb +28 -0
  45. data/sample/memory_test/m2.rb +18 -0
  46. data/sample/memory_test/m3.rb +12 -0
  47. data/sample/message_box.rb +33 -0
  48. data/sample/music_player.rb +137 -0
  49. data/sample/playwave.rb +19 -0
  50. data/sample/primitives.rb +32 -0
  51. data/sample/test_clipboard.rb +16 -0
  52. data/sample/test_controller.rb +62 -0
  53. data/sample/test_joystick.rb +53 -0
  54. data/sample/test_keyboard.rb +52 -0
  55. data/sample/test_mouse.rb +50 -0
  56. data/sample/test_surface.rb +13 -0
  57. data/sample/test_ttf.rb +82 -0
  58. data/sample/test_video.rb +59 -0
  59. data/sample/testgl.rb +175 -0
  60. data/sample/testsprite.rb +296 -0
  61. data/sample/testspriteminimal.rb +75 -0
  62. data/sample/timer.rb +11 -0
  63. data/sample/version.rb +12 -0
  64. data/sample/video_info.rb +64 -0
  65. data/sdl2-win93.gemspec +31 -0
  66. metadata +158 -0
@@ -0,0 +1,339 @@
1
+ /* -*- mode: C -*- */
2
+ #include "rubysdl2_internal.h"
3
+ #include <SDL_joystick.h>
4
+ #include <SDL_gamecontroller.h>
5
+
6
+ static VALUE cJoystick;
7
+ static VALUE cDeviceInfo;
8
+ static VALUE mHat;
9
+
10
+ typedef struct Joystick {
11
+ SDL_Joystick* joystick;
12
+ } Joystick;
13
+
14
+ static void Joystick_free(Joystick* j)
15
+ {
16
+ if (rubysdl2_is_active() && j->joystick)
17
+ SDL_JoystickClose(j->joystick);
18
+ free(j);
19
+ }
20
+
21
+ static VALUE Joystick_new(SDL_Joystick* joystick)
22
+ {
23
+ Joystick* j = ALLOC(Joystick);
24
+ j->joystick = joystick;
25
+ return Data_Wrap_Struct(cJoystick, 0, Joystick_free, j);
26
+ }
27
+
28
+ DEFINE_WRAPPER(SDL_Joystick, Joystick, joystick, cJoystick, "SDL2::Joystick");
29
+
30
+ /*
31
+ * Document-class: SDL2::Joystick
32
+ *
33
+ * This class represents a joystick connected to the machine.
34
+ *
35
+ * In order to use joystick subsystem, {SDL2.init} must have been called
36
+ * with the SDL2::INIT_JOYSTICK flag.
37
+ *
38
+ * @!method destroy?
39
+ * Return true if the device is alread closed.
40
+ * @see #destroy
41
+ */
42
+
43
+ /*
44
+ * Get the number of connected joysticks.
45
+ *
46
+ * @return [Integer]
47
+ */
48
+ static VALUE Joystick_s_num_connected_joysticks(VALUE self)
49
+ {
50
+ return INT2FIX(HANDLE_ERROR(SDL_NumJoysticks()));
51
+ }
52
+
53
+ static VALUE GUID_to_String(SDL_JoystickGUID guid)
54
+ {
55
+ char buf[128];
56
+ SDL_JoystickGetGUIDString(guid, buf, sizeof(buf));
57
+ return rb_usascii_str_new_cstr(buf);
58
+ }
59
+
60
+ /*
61
+ * Get the information of connected joysticks
62
+ *
63
+ * @return [Array<SDL2::Joystick::DeviceInfo>] information of connected devices
64
+ */
65
+ static VALUE Joystick_s_devices(VALUE self)
66
+ {
67
+ int num_joysticks = SDL_NumJoysticks();
68
+ int i;
69
+ VALUE devices = rb_ary_new2(num_joysticks);
70
+ for (i=0; i<num_joysticks; ++i) {
71
+ VALUE device = rb_obj_alloc(cDeviceInfo);
72
+ rb_iv_set(device, "@GUID", GUID_to_String(SDL_JoystickGetDeviceGUID(i)));
73
+ rb_iv_set(device, "@name", utf8str_new_cstr(SDL_JoystickNameForIndex(i)));
74
+ rb_ary_push(devices, device);
75
+ }
76
+ return devices;
77
+ }
78
+
79
+ /*
80
+ * @overload open(device_index)
81
+ * Open a joystick for use.
82
+ *
83
+ * @param [Integer] device_index device index
84
+ * @return [SDL2::Joystick] opended joystick object
85
+ * @raise [SDL2::Error] raised when device open is failed.
86
+ * for exmaple, device_index is out of range.
87
+ */
88
+ static VALUE Joystick_s_open(VALUE self, VALUE device_index)
89
+ {
90
+ SDL_Joystick* joystick = SDL_JoystickOpen(NUM2INT(device_index));
91
+ if (!joystick)
92
+ SDL_ERROR();
93
+ return Joystick_new(joystick);
94
+ }
95
+
96
+ /*
97
+ * @overload game_controller?(index)
98
+ * Return true if the joystick of given index supports the game controller
99
+ * interface.
100
+ *
101
+ * @param [Integer] index the joystick device index
102
+ * @see SDL2::GameController
103
+ *
104
+ */
105
+ static VALUE Joystick_s_game_controller_p(VALUE self, VALUE index)
106
+ {
107
+ return INT2BOOL(SDL_IsGameController(NUM2INT(index)));
108
+ }
109
+
110
+ /*
111
+ * Return true a joystick has been opened and currently connected.
112
+ */
113
+ static VALUE Joystick_attached_p(VALUE self)
114
+ {
115
+ Joystick* j = Get_Joystick(self);
116
+ if (!j->joystick)
117
+ return Qfalse;
118
+ return INT2BOOL(SDL_JoystickGetAttached(j->joystick));
119
+ }
120
+
121
+ /*
122
+ * Get the joystick GUID
123
+ *
124
+ * @return [String] GUID string
125
+ */
126
+ static VALUE Joystick_GUID(VALUE self)
127
+ {
128
+ SDL_JoystickGUID guid;
129
+ char buf[128];
130
+ guid = SDL_JoystickGetGUID(Get_SDL_Joystick(self));
131
+ SDL_JoystickGetGUIDString(guid, buf, sizeof(buf));
132
+ return rb_usascii_str_new_cstr(buf);
133
+ }
134
+
135
+ /*
136
+ * Get the index of a joystick
137
+ *
138
+ * @return [Integer] index
139
+ */
140
+ static VALUE Joystick_index(VALUE self)
141
+ {
142
+ return INT2NUM(HANDLE_ERROR(SDL_JoystickInstanceID(Get_SDL_Joystick(self))));
143
+ }
144
+
145
+ /*
146
+ * Close a joystick device.
147
+ *
148
+ * @return [nil]
149
+ * @see #destroy?
150
+ */
151
+ static VALUE Joystick_destroy(VALUE self)
152
+ {
153
+ Joystick* j = Get_Joystick(self);
154
+ if (j->joystick)
155
+ SDL_JoystickClose(j->joystick);
156
+ j->joystick = NULL;
157
+ return Qnil;
158
+ }
159
+
160
+ /*
161
+ * Get the name of a joystick
162
+ *
163
+ * @return [String] name
164
+ */
165
+ static VALUE Joystick_name(VALUE self)
166
+ {
167
+ return utf8str_new_cstr(SDL_JoystickName(Get_SDL_Joystick(self)));
168
+ }
169
+
170
+ /*
171
+ * Get the number of general axis controls on a joystick.
172
+ * @return [Integer]
173
+ * @see #axis
174
+ */
175
+ static VALUE Joystick_num_axes(VALUE self)
176
+ {
177
+ return INT2FIX(SDL_JoystickNumAxes(Get_SDL_Joystick(self)));
178
+ }
179
+
180
+ /*
181
+ * Get the number of trackball on a joystick
182
+ * @return [Integer]
183
+ * @see #ball
184
+ */
185
+ static VALUE Joystick_num_balls(VALUE self)
186
+ {
187
+ return INT2FIX(SDL_JoystickNumBalls(Get_SDL_Joystick(self)));
188
+ }
189
+
190
+ /*
191
+ * Get the number of button on a joystick
192
+ * @return [Integer]
193
+ * @see #button
194
+ */
195
+ static VALUE Joystick_num_buttons(VALUE self)
196
+ {
197
+ return INT2FIX(SDL_JoystickNumButtons(Get_SDL_Joystick(self)));
198
+ }
199
+
200
+ /*
201
+ * Get the number of POV hats on a joystick
202
+ * @return [Integer]
203
+ * @see #hat
204
+ */
205
+ static VALUE Joystick_num_hats(VALUE self)
206
+ {
207
+ return INT2FIX(SDL_JoystickNumHats(Get_SDL_Joystick(self)));
208
+ }
209
+
210
+ /*
211
+ * @overload axis(which)
212
+ * Get the current state of an axis control on a joystick.
213
+ *
214
+ * @param [Integer] which an index of an axis, started at index 0
215
+ * @return [Integer] state value, ranging from -32768 to 32767.
216
+ * @see #num_axes
217
+ */
218
+ static VALUE Joystick_axis(VALUE self, VALUE which)
219
+ {
220
+ return INT2FIX(SDL_JoystickGetAxis(Get_SDL_Joystick(self), NUM2INT(which)));
221
+ }
222
+
223
+ /*
224
+ * @overload ball(which)
225
+ * Get the current state of a trackball on a joystick.
226
+ *
227
+ * @param [Integer] which an index of a trackball, started at index 0
228
+ * @return [[Integer,Integer]] dx and dy
229
+ * @see #num_balls
230
+ */
231
+ static VALUE Joystick_ball(VALUE self, VALUE which)
232
+ {
233
+ int dx, dy;
234
+ HANDLE_ERROR(SDL_JoystickGetBall(Get_SDL_Joystick(self), NUM2INT(which), &dx, &dy));
235
+ return rb_ary_new3(2, INT2NUM(dx), INT2NUM(dy));
236
+ }
237
+
238
+ /*
239
+ * @overload button(which)
240
+ * Get the current state of a button on a joystick.
241
+ *
242
+ * @param [Integer] which an index of a button, started at index 0
243
+ * @return [Boolean] true if the button is pressed
244
+ * @see #num_buttons
245
+ */
246
+ static VALUE Joystick_button(VALUE self, VALUE which)
247
+ {
248
+ return INT2BOOL(SDL_JoystickGetButton(Get_SDL_Joystick(self), NUM2INT(which)));
249
+ }
250
+
251
+ /*
252
+ * @overload hat(which)
253
+ * Get the current state of a POV hat on a joystick.
254
+ *
255
+ * @param [Integer] which an index of a hat, started at index 0
256
+ * @return [Integer] hat state
257
+ * @see #num_hats
258
+ */
259
+ static VALUE Joystick_hat(VALUE self, VALUE which)
260
+ {
261
+ return UINT2NUM(SDL_JoystickGetHat(Get_SDL_Joystick(self), NUM2INT(which)));
262
+ }
263
+
264
+ /*
265
+ * Document-class: SDL2::Joystick::DeviceInfo
266
+ *
267
+ * This class represents joystick device information, its name and GUID.
268
+ *
269
+ * You can get the information with {SDL2::Joystick.devices}.
270
+ */
271
+
272
+ /*
273
+ * Document-module: SDL2::Joystick::Hat
274
+ *
275
+ * This module provides constants of joysticks's hat positions used by {SDL2::Joystick} class.
276
+ * The position of the hat is represented by OR'd bits of {RIGHT}, {LEFT}, {UP}, and {DOWN}.
277
+ * This means the center position ({CENTERED}) is represeted by 0 and
278
+ * the left up position {LEFTUP} is represeted by ({LEFT}|{UP}).
279
+ */
280
+
281
+ void rubysdl2_init_joystick(void)
282
+ {
283
+ cJoystick = rb_define_class_under(mSDL2, "Joystick", rb_cObject);
284
+ cDeviceInfo = rb_define_class_under(cJoystick, "DeviceInfo", rb_cObject);
285
+
286
+ rb_define_singleton_method(cJoystick, "num_connected_joysticks",
287
+ Joystick_s_num_connected_joysticks, 0);
288
+ rb_define_singleton_method(cJoystick, "devices", Joystick_s_devices, 0);
289
+ rb_define_singleton_method(cJoystick, "open", Joystick_s_open, 1);
290
+ rb_define_singleton_method(cJoystick, "game_controller?",
291
+ Joystick_s_game_controller_p, 1);
292
+ rb_define_method(cJoystick, "destroy?", Joystick_destroy_p, 0);
293
+ rb_define_alias(cJoystick, "close?", "destroy?");
294
+ rb_define_method(cJoystick, "attached?", Joystick_attached_p, 0);
295
+ rb_define_method(cJoystick, "GUID", Joystick_GUID, 0);
296
+ rb_define_method(cJoystick, "index", Joystick_index, 0);
297
+ rb_define_method(cJoystick, "destroy", Joystick_destroy, 0);
298
+ rb_define_alias(cJoystick, "close", "destroy");
299
+ rb_define_method(cJoystick, "name", Joystick_name, 0);
300
+ rb_define_method(cJoystick, "num_axes", Joystick_num_axes, 0);
301
+ rb_define_method(cJoystick, "num_balls", Joystick_num_balls, 0);
302
+ rb_define_method(cJoystick, "num_buttons", Joystick_num_buttons, 0);
303
+ rb_define_method(cJoystick, "num_hats", Joystick_num_hats, 0);
304
+ rb_define_method(cJoystick, "axis", Joystick_axis, 1);
305
+ rb_define_method(cJoystick, "ball", Joystick_ball, 1);
306
+ rb_define_method(cJoystick, "button", Joystick_button, 1);
307
+ rb_define_method(cJoystick, "hat", Joystick_hat, 1);
308
+
309
+ mHat = rb_define_module_under(cJoystick, "Hat");
310
+
311
+ /* define(`DEFINE_JOY_HAT_CONST',`rb_define_const(mHat, "$1", INT2NUM(SDL_HAT_$1))') */
312
+ /* Center position. Equal to 0. */
313
+ DEFINE_JOY_HAT_CONST(CENTERED);
314
+ /* Up position. */
315
+ DEFINE_JOY_HAT_CONST(UP);
316
+ /* Right position. */
317
+ DEFINE_JOY_HAT_CONST(RIGHT);
318
+ /* Down position. */
319
+ DEFINE_JOY_HAT_CONST(DOWN);
320
+ /* Left position. */
321
+ DEFINE_JOY_HAT_CONST(LEFT);
322
+ /* Right Up position. Equal to ({RIGHT} | {UP}) */
323
+ DEFINE_JOY_HAT_CONST(RIGHTUP);
324
+ /* Right Down position. Equal to ({RIGHT} | {DOWN}) */
325
+ DEFINE_JOY_HAT_CONST(RIGHTDOWN);
326
+ /* Left Up position. Equal to ({LEFT} | {UP}) */
327
+ DEFINE_JOY_HAT_CONST(LEFTUP);
328
+ /* Left Down position. Equal to ({LEFT} | {DOWN}) */
329
+ DEFINE_JOY_HAT_CONST(LEFTDOWN);
330
+
331
+ /* Device GUID
332
+ * @return [String] */
333
+ rb_define_attr(cDeviceInfo, "GUID", 1, 0);
334
+ /* Device name
335
+ * @return [String] */
336
+ rb_define_attr(cDeviceInfo, "name", 1, 0);
337
+
338
+
339
+ }
@@ -0,0 +1,1302 @@
1
+ /* -*- C -*- */
2
+ #include "rubysdl2_internal.h"
3
+ #include <SDL_events.h>
4
+ #include <SDL_keyboard.h>
5
+ #include <SDL_keycode.h>
6
+ #include <SDL_scancode.h>
7
+
8
+ static VALUE mKey;
9
+ static VALUE mScan;
10
+ static VALUE mMod;
11
+ static VALUE mTextInput;
12
+
13
+ /*
14
+ * Document-module: SDL2::Key
15
+ *
16
+ * This module has "virtual" keycode constants and some
17
+ * keyboard input handling functions.
18
+ *
19
+ */
20
+
21
+ /*
22
+ * @overload name_of(code)
23
+ * @param [Integer] code keycode
24
+ *
25
+ * Get a human-readable name for a key
26
+ *
27
+ * @return [String] the name of given keycode
28
+ * @see .keycode_from_name
29
+ * @see SDL2::Key::Scan.name_of
30
+ */
31
+ static VALUE Key_s_name_of(VALUE self, VALUE code)
32
+ {
33
+ return utf8str_new_cstr(SDL_GetKeyName(NUM2INT(code)));
34
+ }
35
+
36
+ /*
37
+ * @overload keycode_from_name(name)
38
+ * @param [String] name name of a key
39
+ *
40
+ * Get a key code from given name
41
+ * @return [Integer] keycode
42
+ * @see .name_of
43
+ * @see SDL2::Key::Scan.from_name
44
+ */
45
+ static VALUE Key_s_keycode_from_name(VALUE self, VALUE name)
46
+ {
47
+ return INT2NUM(SDL_GetKeyFromName(StringValueCStr(name)));
48
+ }
49
+
50
+ /*
51
+ * @overload keycode_from_scancode(scancode)
52
+ * @param [Integer] scancode scancode
53
+ *
54
+ * Convert a scancode to the corresponding keycode
55
+ *
56
+ * @return [Integer]
57
+ * @see SDL2::Key::Scan.from_keycode
58
+ */
59
+ static VALUE Key_s_keycode_from_scancode(VALUE self, VALUE scancode)
60
+ {
61
+ return INT2NUM(SDL_GetKeyFromScancode(NUM2INT(scancode)));
62
+ }
63
+
64
+ /*
65
+ * @overload pressed?(code)
66
+ * @param [Integer] code scancode
67
+ *
68
+ * Get whether the key of the given scancode is pressed or not.
69
+ */
70
+ static VALUE Key_s_pressed_p(VALUE self, VALUE code)
71
+ {
72
+ const Uint8* state = SDL_GetKeyboardState(NULL);
73
+ SDL_Scancode scancode;
74
+ if (!state) {
75
+ SDL_PumpEvents();
76
+ state = SDL_GetKeyboardState(NULL);
77
+ if (!state)
78
+ rb_raise(eSDL2Error, "Event subsystem is not initialized");
79
+ }
80
+ scancode = NUM2UINT(code);
81
+ if (scancode >= SDL_NUM_SCANCODES)
82
+ rb_raise(rb_eArgError, "too large scancode %d", scancode);
83
+
84
+ return INT2BOOL(state[scancode]);
85
+ }
86
+
87
+ /*
88
+ * Document-module: SDL2::Key::Scan
89
+ *
90
+ * This module has "physical" key scancode constants and some
91
+ * scancode handling functions.
92
+ */
93
+
94
+ /*
95
+ * @overload name_of(code)
96
+ * @param [Integer] code scancode
97
+ *
98
+ * Get a human-readable name of the given scancode
99
+ * @return [String]
100
+ * @see SDL2::Key.name_of
101
+ * @see .from_name
102
+ */
103
+ static VALUE Scan_s_name_of(VALUE self, VALUE code)
104
+ {
105
+ return utf8str_new_cstr(SDL_GetScancodeName(NUM2INT(code)));
106
+ }
107
+
108
+ /*
109
+ * @overload from_name(name)
110
+ * @param [String] name name of a key
111
+ *
112
+ * Get a scancode from the key of the given name
113
+ * @return [String]
114
+ * @see .name_of
115
+ * @see SDL2::Key.keycode_from_name
116
+ */
117
+ static VALUE Scan_s_from_name(VALUE self, VALUE name)
118
+ {
119
+ return INT2NUM(SDL_GetScancodeFromName(StringValueCStr(name)));
120
+ }
121
+
122
+ /*
123
+ * @overload from_keycode(keycode)
124
+ * @param [Integer] keycode keycode
125
+ *
126
+ * Get a keycode corresponding to the given keycode
127
+ * @return [Integer] keycode
128
+ * @see SDL2::Key.keycode_from_scancode
129
+ */
130
+ static VALUE Scan_s_from_keycode(VALUE self, VALUE keycode)
131
+ {
132
+ return INT2NUM(SDL_GetScancodeFromKey(NUM2INT(keycode)));
133
+ }
134
+
135
+ /*
136
+ * Document-module: SDL2::Key::Mod
137
+ *
138
+ * This module has key modifier bitmask constants and
139
+ * some functions to handle key modifier states.
140
+ */
141
+
142
+ /*
143
+ * Get the current key modifier state
144
+ *
145
+ * You can examine whether the modifier key is pressed
146
+ * using bitmask constants of {SDL2::Key::Mod}.
147
+ *
148
+ * @return [Integer] key state
149
+ */
150
+ static VALUE Mod_s_state(VALUE self)
151
+ {
152
+ return UINT2NUM(SDL_GetModState());
153
+ }
154
+
155
+ /*
156
+ * @overload state=(keymod)
157
+ * @param [Integer] keymod key modifier flags (bits)
158
+ *
159
+ * Set the current key modifier state
160
+ *
161
+ * @note This does not change the keyboard state, only the key modifier flags.
162
+ * @return [keymod]
163
+ * @see .state
164
+ */
165
+ static VALUE Mod_s_set_state(VALUE self, VALUE keymod)
166
+ {
167
+ SDL_SetModState(NUM2UINT(keymod));
168
+ return Qnil;
169
+ }
170
+
171
+ /*
172
+ * Document-module: SDL2::TextInput
173
+ *
174
+ * This module provides Unicode text input support.
175
+ *
176
+ * Normally, you can handle key inputs from key events
177
+ * and {SDL2::Key} module. This module is required to
178
+ * input thousands kinds of symbols like CJK languages.
179
+ * Please see {https://wiki.libsdl.org/Tutorials/TextInput}
180
+ * to understand the concept of Unicode text input.
181
+ */
182
+
183
+ /*
184
+ * Return true if Unicode text input events are enabled.
185
+ *
186
+ * @see .start
187
+ * @see .stop
188
+ */
189
+ static VALUE TextInput_s_active_p(VALUE self)
190
+ {
191
+ return INT2BOOL(SDL_IsTextInputActive());
192
+ }
193
+
194
+ /*
195
+ * Enable Unicode input events.
196
+ *
197
+ * @return [nil]
198
+ * @see .stop
199
+ * @see .active?
200
+ */
201
+ static VALUE TextInput_s_start(VALUE self)
202
+ {
203
+ SDL_StartTextInput(); return Qnil;
204
+ }
205
+
206
+ /*
207
+ * Disable Unicode input events.
208
+ *
209
+ * @return [nil]
210
+ * @see .start
211
+ * @see .active?
212
+ */
213
+ static VALUE TextInput_s_stop(VALUE self)
214
+ {
215
+ SDL_StopTextInput(); return Qnil;
216
+ }
217
+
218
+ /*
219
+ * @overload rect=(rect)
220
+ * Set the rectanlgle used to type Unicode text inputs.
221
+ *
222
+ * @param rect [SDL2::Rect] the rectangle to receive text
223
+ * @return [rect]
224
+ */
225
+ static VALUE TextInput_s_set_rect(VALUE self, VALUE rect)
226
+ {
227
+ SDL_Rect *r = Get_SDL_Rect(rect);
228
+ SDL_SetTextInputRect(r);
229
+ return rect;
230
+ }
231
+
232
+ /*
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+
243
+
244
+
245
+
246
+ */
247
+ void rubysdl2_init_key(void)
248
+ {
249
+ mKey = rb_define_module_under(mSDL2, "Key");
250
+ mScan = rb_define_module_under(mKey, "Scan");
251
+ mMod = rb_define_module_under(mKey, "Mod");
252
+ mTextInput = rb_define_module_under(mSDL2, "TextInput");
253
+
254
+ rb_define_module_function(mKey, "name_of", Key_s_name_of, 1);
255
+ rb_define_module_function(mKey, "keycode_from_name", Key_s_keycode_from_name, 1);
256
+ rb_define_module_function(mKey, "keycode_from_scancode", Key_s_keycode_from_scancode, 1);
257
+ rb_define_module_function(mKey, "pressed?", Key_s_pressed_p, 1);
258
+ rb_define_module_function(mScan, "name_of", Scan_s_name_of, 1);
259
+ rb_define_module_function(mScan, "from_name", Scan_s_from_name, 1);
260
+ rb_define_module_function(mScan, "from_keycode", Scan_s_from_keycode, 1);
261
+ rb_define_module_function(mMod, "state", Mod_s_state, 0);
262
+ rb_define_module_function(mMod, "state=", Mod_s_set_state, 1);
263
+ rb_define_module_function(mTextInput, "active?", TextInput_s_active_p, 0);
264
+ rb_define_module_function(mTextInput, "start", TextInput_s_start, 0);
265
+ rb_define_module_function(mTextInput, "stop", TextInput_s_stop, 0);
266
+ rb_define_module_function(mTextInput, "rect=", TextInput_s_set_rect, 1);
267
+
268
+ /* @return [Integer] unused scancode */
269
+ rb_define_const(mScan, "UNKNOWN", INT2NUM(SDL_SCANCODE_UNKNOWN));
270
+ /* @return [Integer] scancode for alphabet key "A" */
271
+ rb_define_const(mScan, "A", INT2NUM(SDL_SCANCODE_A));
272
+ /* @return [Integer] scancode for alphabet key "B" */
273
+ rb_define_const(mScan, "B", INT2NUM(SDL_SCANCODE_B));
274
+ /* @return [Integer] scancode for alphabet key "C" */
275
+ rb_define_const(mScan, "C", INT2NUM(SDL_SCANCODE_C));
276
+ /* @return [Integer] scancode for alphabet key "D" */
277
+ rb_define_const(mScan, "D", INT2NUM(SDL_SCANCODE_D));
278
+ /* @return [Integer] scancode for alphabet key "E" */
279
+ rb_define_const(mScan, "E", INT2NUM(SDL_SCANCODE_E));
280
+ /* @return [Integer] scancode for alphabet key "F" */
281
+ rb_define_const(mScan, "F", INT2NUM(SDL_SCANCODE_F));
282
+ /* @return [Integer] scancode for alphabet key "G" */
283
+ rb_define_const(mScan, "G", INT2NUM(SDL_SCANCODE_G));
284
+ /* @return [Integer] scancode for alphabet key "H" */
285
+ rb_define_const(mScan, "H", INT2NUM(SDL_SCANCODE_H));
286
+ /* @return [Integer] scancode for alphabet key "I" */
287
+ rb_define_const(mScan, "I", INT2NUM(SDL_SCANCODE_I));
288
+ /* @return [Integer] scancode for alphabet key "J" */
289
+ rb_define_const(mScan, "J", INT2NUM(SDL_SCANCODE_J));
290
+ /* @return [Integer] scancode for alphabet key "K" */
291
+ rb_define_const(mScan, "K", INT2NUM(SDL_SCANCODE_K));
292
+ /* @return [Integer] scancode for alphabet key "L" */
293
+ rb_define_const(mScan, "L", INT2NUM(SDL_SCANCODE_L));
294
+ /* @return [Integer] scancode for alphabet key "M" */
295
+ rb_define_const(mScan, "M", INT2NUM(SDL_SCANCODE_M));
296
+ /* @return [Integer] scancode for alphabet key "N" */
297
+ rb_define_const(mScan, "N", INT2NUM(SDL_SCANCODE_N));
298
+ /* @return [Integer] scancode for alphabet key "O" */
299
+ rb_define_const(mScan, "O", INT2NUM(SDL_SCANCODE_O));
300
+ /* @return [Integer] scancode for alphabet key "P" */
301
+ rb_define_const(mScan, "P", INT2NUM(SDL_SCANCODE_P));
302
+ /* @return [Integer] scancode for alphabet key "Q" */
303
+ rb_define_const(mScan, "Q", INT2NUM(SDL_SCANCODE_Q));
304
+ /* @return [Integer] scancode for alphabet key "R" */
305
+ rb_define_const(mScan, "R", INT2NUM(SDL_SCANCODE_R));
306
+ /* @return [Integer] scancode for alphabet key "S" */
307
+ rb_define_const(mScan, "S", INT2NUM(SDL_SCANCODE_S));
308
+ /* @return [Integer] scancode for alphabet key "T" */
309
+ rb_define_const(mScan, "T", INT2NUM(SDL_SCANCODE_T));
310
+ /* @return [Integer] scancode for alphabet key "U" */
311
+ rb_define_const(mScan, "U", INT2NUM(SDL_SCANCODE_U));
312
+ /* @return [Integer] scancode for alphabet key "V" */
313
+ rb_define_const(mScan, "V", INT2NUM(SDL_SCANCODE_V));
314
+ /* @return [Integer] scancode for alphabet key "W" */
315
+ rb_define_const(mScan, "W", INT2NUM(SDL_SCANCODE_W));
316
+ /* @return [Integer] scancode for alphabet key "X" */
317
+ rb_define_const(mScan, "X", INT2NUM(SDL_SCANCODE_X));
318
+ /* @return [Integer] scancode for alphabet key "Y" */
319
+ rb_define_const(mScan, "Y", INT2NUM(SDL_SCANCODE_Y));
320
+ /* @return [Integer] scancode for alphabet key "Z" */
321
+ rb_define_const(mScan, "Z", INT2NUM(SDL_SCANCODE_Z));
322
+
323
+ /* @return [Integer] scancode for number key "1" (not on keypad) */
324
+ rb_define_const(mScan, "K1", INT2NUM(SDL_SCANCODE_1));
325
+ /* @return [Integer] scancode for number key "2" (not on keypad) */
326
+ rb_define_const(mScan, "K2", INT2NUM(SDL_SCANCODE_2));
327
+ /* @return [Integer] scancode for number key "3" (not on keypad) */
328
+ rb_define_const(mScan, "K3", INT2NUM(SDL_SCANCODE_3));
329
+ /* @return [Integer] scancode for number key "4" (not on keypad) */
330
+ rb_define_const(mScan, "K4", INT2NUM(SDL_SCANCODE_4));
331
+ /* @return [Integer] scancode for number key "5" (not on keypad) */
332
+ rb_define_const(mScan, "K5", INT2NUM(SDL_SCANCODE_5));
333
+ /* @return [Integer] scancode for number key "6" (not on keypad) */
334
+ rb_define_const(mScan, "K6", INT2NUM(SDL_SCANCODE_6));
335
+ /* @return [Integer] scancode for number key "7" (not on keypad) */
336
+ rb_define_const(mScan, "K7", INT2NUM(SDL_SCANCODE_7));
337
+ /* @return [Integer] scancode for number key "8" (not on keypad) */
338
+ rb_define_const(mScan, "K8", INT2NUM(SDL_SCANCODE_8));
339
+ /* @return [Integer] scancode for number key "9" (not on keypad) */
340
+ rb_define_const(mScan, "K9", INT2NUM(SDL_SCANCODE_9));
341
+ /* @return [Integer] scancode for number key "0" (not on keypad) */
342
+ rb_define_const(mScan, "K0", INT2NUM(SDL_SCANCODE_0));
343
+
344
+ /* @return [Integer] scancode for "RETURN" key */
345
+ rb_define_const(mScan, "RETURN", INT2NUM(SDL_SCANCODE_RETURN));
346
+ /* @return [Integer] scancode for "ESCAPE" key */
347
+ rb_define_const(mScan, "ESCAPE", INT2NUM(SDL_SCANCODE_ESCAPE));
348
+ /* @return [Integer] scancode for "BACKSPACE" key */
349
+ rb_define_const(mScan, "BACKSPACE", INT2NUM(SDL_SCANCODE_BACKSPACE));
350
+ /* @return [Integer] scancode for "TAB" key */
351
+ rb_define_const(mScan, "TAB", INT2NUM(SDL_SCANCODE_TAB));
352
+ /* @return [Integer] scancode for "SPACE" key */
353
+ rb_define_const(mScan, "SPACE", INT2NUM(SDL_SCANCODE_SPACE));
354
+
355
+ /* @return [Integer] scancode for "MINUS" key */
356
+ rb_define_const(mScan, "MINUS", INT2NUM(SDL_SCANCODE_MINUS));
357
+ /* @return [Integer] scancode for "EQUALS" key */
358
+ rb_define_const(mScan, "EQUALS", INT2NUM(SDL_SCANCODE_EQUALS));
359
+ /* @return [Integer] scancode for "LEFTBRACKET" key */
360
+ rb_define_const(mScan, "LEFTBRACKET", INT2NUM(SDL_SCANCODE_LEFTBRACKET));
361
+ /* @return [Integer] scancode for "RIGHTBRACKET" key */
362
+ rb_define_const(mScan, "RIGHTBRACKET", INT2NUM(SDL_SCANCODE_RIGHTBRACKET));
363
+ /* @return [Integer] scancode for "BACKSLASH" key */
364
+ rb_define_const(mScan, "BACKSLASH", INT2NUM(SDL_SCANCODE_BACKSLASH));
365
+
366
+ /* @return [Integer] scancode for "NONUSHASH" key */
367
+ rb_define_const(mScan, "NONUSHASH", INT2NUM(SDL_SCANCODE_NONUSHASH));
368
+ /* @return [Integer] scancode for "SEMICOLON" key */
369
+ rb_define_const(mScan, "SEMICOLON", INT2NUM(SDL_SCANCODE_SEMICOLON));
370
+ /* @return [Integer] scancode for "APOSTROPHE" key */
371
+ rb_define_const(mScan, "APOSTROPHE", INT2NUM(SDL_SCANCODE_APOSTROPHE));
372
+ /* @return [Integer] scancode for "GRAVE" key */
373
+ rb_define_const(mScan, "GRAVE", INT2NUM(SDL_SCANCODE_GRAVE));
374
+ /* @return [Integer] scancode for "COMMA" key */
375
+ rb_define_const(mScan, "COMMA", INT2NUM(SDL_SCANCODE_COMMA));
376
+ /* @return [Integer] scancode for "PERIOD" key */
377
+ rb_define_const(mScan, "PERIOD", INT2NUM(SDL_SCANCODE_PERIOD));
378
+ /* @return [Integer] scancode for "SLASH" key */
379
+ rb_define_const(mScan, "SLASH", INT2NUM(SDL_SCANCODE_SLASH));
380
+
381
+ /* @return [Integer] scancode for "CAPSLOCK" key */
382
+ rb_define_const(mScan, "CAPSLOCK", INT2NUM(SDL_SCANCODE_CAPSLOCK));
383
+
384
+ /* @return [Integer] scancode for "F1" key */
385
+ rb_define_const(mScan, "F1", INT2NUM(SDL_SCANCODE_F1));
386
+ /* @return [Integer] scancode for "F2" key */
387
+ rb_define_const(mScan, "F2", INT2NUM(SDL_SCANCODE_F2));
388
+ /* @return [Integer] scancode for "F3" key */
389
+ rb_define_const(mScan, "F3", INT2NUM(SDL_SCANCODE_F3));
390
+ /* @return [Integer] scancode for "F4" key */
391
+ rb_define_const(mScan, "F4", INT2NUM(SDL_SCANCODE_F4));
392
+ /* @return [Integer] scancode for "F5" key */
393
+ rb_define_const(mScan, "F5", INT2NUM(SDL_SCANCODE_F5));
394
+ /* @return [Integer] scancode for "F6" key */
395
+ rb_define_const(mScan, "F6", INT2NUM(SDL_SCANCODE_F6));
396
+ /* @return [Integer] scancode for "F7" key */
397
+ rb_define_const(mScan, "F7", INT2NUM(SDL_SCANCODE_F7));
398
+ /* @return [Integer] scancode for "F8" key */
399
+ rb_define_const(mScan, "F8", INT2NUM(SDL_SCANCODE_F8));
400
+ /* @return [Integer] scancode for "F9" key */
401
+ rb_define_const(mScan, "F9", INT2NUM(SDL_SCANCODE_F9));
402
+ /* @return [Integer] scancode for "F10" key */
403
+ rb_define_const(mScan, "F10", INT2NUM(SDL_SCANCODE_F10));
404
+ /* @return [Integer] scancode for "F11" key */
405
+ rb_define_const(mScan, "F11", INT2NUM(SDL_SCANCODE_F11));
406
+ /* @return [Integer] scancode for "F12" key */
407
+ rb_define_const(mScan, "F12", INT2NUM(SDL_SCANCODE_F12));
408
+
409
+ /* @return [Integer] scancode for "PRINTSCREEN" key */
410
+ rb_define_const(mScan, "PRINTSCREEN", INT2NUM(SDL_SCANCODE_PRINTSCREEN));
411
+ /* @return [Integer] scancode for "SCROLLLOCK" key */
412
+ rb_define_const(mScan, "SCROLLLOCK", INT2NUM(SDL_SCANCODE_SCROLLLOCK));
413
+ /* @return [Integer] scancode for "PAUSE" key */
414
+ rb_define_const(mScan, "PAUSE", INT2NUM(SDL_SCANCODE_PAUSE));
415
+ /* @return [Integer] scancode for "INSERT" key */
416
+ rb_define_const(mScan, "INSERT", INT2NUM(SDL_SCANCODE_INSERT));
417
+
418
+ /* @return [Integer] scancode for "HOME" key */
419
+ rb_define_const(mScan, "HOME", INT2NUM(SDL_SCANCODE_HOME));
420
+ /* @return [Integer] scancode for "PAGEUP" key */
421
+ rb_define_const(mScan, "PAGEUP", INT2NUM(SDL_SCANCODE_PAGEUP));
422
+ /* @return [Integer] scancode for "DELETE" key */
423
+ rb_define_const(mScan, "DELETE", INT2NUM(SDL_SCANCODE_DELETE));
424
+ /* @return [Integer] scancode for "END" key */
425
+ rb_define_const(mScan, "END", INT2NUM(SDL_SCANCODE_END));
426
+ /* @return [Integer] scancode for "PAGEDOWN" key */
427
+ rb_define_const(mScan, "PAGEDOWN", INT2NUM(SDL_SCANCODE_PAGEDOWN));
428
+ /* @return [Integer] scancode for "RIGHT" key */
429
+ rb_define_const(mScan, "RIGHT", INT2NUM(SDL_SCANCODE_RIGHT));
430
+ /* @return [Integer] scancode for "LEFT" key */
431
+ rb_define_const(mScan, "LEFT", INT2NUM(SDL_SCANCODE_LEFT));
432
+ /* @return [Integer] scancode for "DOWN" key */
433
+ rb_define_const(mScan, "DOWN", INT2NUM(SDL_SCANCODE_DOWN));
434
+ /* @return [Integer] scancode for "UP" key */
435
+ rb_define_const(mScan, "UP", INT2NUM(SDL_SCANCODE_UP));
436
+
437
+ /* @return [Integer] scancode for "NUMLOCKCLEAR" key */
438
+ rb_define_const(mScan, "NUMLOCKCLEAR", INT2NUM(SDL_SCANCODE_NUMLOCKCLEAR));
439
+
440
+ /* @return [Integer] scancode for "KP_DIVIDE" key */
441
+ rb_define_const(mScan, "KP_DIVIDE", INT2NUM(SDL_SCANCODE_KP_DIVIDE));
442
+ /* @return [Integer] scancode for "KP_MULTIPLY" key */
443
+ rb_define_const(mScan, "KP_MULTIPLY", INT2NUM(SDL_SCANCODE_KP_MULTIPLY));
444
+ /* @return [Integer] scancode for "KP_MINUS" key */
445
+ rb_define_const(mScan, "KP_MINUS", INT2NUM(SDL_SCANCODE_KP_MINUS));
446
+ /* @return [Integer] scancode for "KP_PLUS" key */
447
+ rb_define_const(mScan, "KP_PLUS", INT2NUM(SDL_SCANCODE_KP_PLUS));
448
+ /* @return [Integer] scancode for "KP_ENTER" key */
449
+ rb_define_const(mScan, "KP_ENTER", INT2NUM(SDL_SCANCODE_KP_ENTER));
450
+ /* @return [Integer] scancode for "KP_1" key */
451
+ rb_define_const(mScan, "KP_1", INT2NUM(SDL_SCANCODE_KP_1));
452
+ /* @return [Integer] scancode for "KP_2" key */
453
+ rb_define_const(mScan, "KP_2", INT2NUM(SDL_SCANCODE_KP_2));
454
+ /* @return [Integer] scancode for "KP_3" key */
455
+ rb_define_const(mScan, "KP_3", INT2NUM(SDL_SCANCODE_KP_3));
456
+ /* @return [Integer] scancode for "KP_4" key */
457
+ rb_define_const(mScan, "KP_4", INT2NUM(SDL_SCANCODE_KP_4));
458
+ /* @return [Integer] scancode for "KP_5" key */
459
+ rb_define_const(mScan, "KP_5", INT2NUM(SDL_SCANCODE_KP_5));
460
+ /* @return [Integer] scancode for "KP_6" key */
461
+ rb_define_const(mScan, "KP_6", INT2NUM(SDL_SCANCODE_KP_6));
462
+ /* @return [Integer] scancode for "KP_7" key */
463
+ rb_define_const(mScan, "KP_7", INT2NUM(SDL_SCANCODE_KP_7));
464
+ /* @return [Integer] scancode for "KP_8" key */
465
+ rb_define_const(mScan, "KP_8", INT2NUM(SDL_SCANCODE_KP_8));
466
+ /* @return [Integer] scancode for "KP_9" key */
467
+ rb_define_const(mScan, "KP_9", INT2NUM(SDL_SCANCODE_KP_9));
468
+ /* @return [Integer] scancode for "KP_0" key */
469
+ rb_define_const(mScan, "KP_0", INT2NUM(SDL_SCANCODE_KP_0));
470
+ /* @return [Integer] scancode for "KP_PERIOD" key */
471
+ rb_define_const(mScan, "KP_PERIOD", INT2NUM(SDL_SCANCODE_KP_PERIOD));
472
+
473
+ /* @return [Integer] scancode for "NONUSBACKSLASH" key */
474
+ rb_define_const(mScan, "NONUSBACKSLASH", INT2NUM(SDL_SCANCODE_NONUSBACKSLASH));
475
+ /* @return [Integer] scancode for "APPLICATION" key */
476
+ rb_define_const(mScan, "APPLICATION", INT2NUM(SDL_SCANCODE_APPLICATION));
477
+ /* @return [Integer] scancode for "POWER" key */
478
+ rb_define_const(mScan, "POWER", INT2NUM(SDL_SCANCODE_POWER));
479
+ /* @return [Integer] scancode for "KP_EQUALS" key */
480
+ rb_define_const(mScan, "KP_EQUALS", INT2NUM(SDL_SCANCODE_KP_EQUALS));
481
+ /* @return [Integer] scancode for "F13" key */
482
+ rb_define_const(mScan, "F13", INT2NUM(SDL_SCANCODE_F13));
483
+ /* @return [Integer] scancode for "F14" key */
484
+ rb_define_const(mScan, "F14", INT2NUM(SDL_SCANCODE_F14));
485
+ /* @return [Integer] scancode for "F15" key */
486
+ rb_define_const(mScan, "F15", INT2NUM(SDL_SCANCODE_F15));
487
+ /* @return [Integer] scancode for "F16" key */
488
+ rb_define_const(mScan, "F16", INT2NUM(SDL_SCANCODE_F16));
489
+ /* @return [Integer] scancode for "F17" key */
490
+ rb_define_const(mScan, "F17", INT2NUM(SDL_SCANCODE_F17));
491
+ /* @return [Integer] scancode for "F18" key */
492
+ rb_define_const(mScan, "F18", INT2NUM(SDL_SCANCODE_F18));
493
+ /* @return [Integer] scancode for "F19" key */
494
+ rb_define_const(mScan, "F19", INT2NUM(SDL_SCANCODE_F19));
495
+ /* @return [Integer] scancode for "F20" key */
496
+ rb_define_const(mScan, "F20", INT2NUM(SDL_SCANCODE_F20));
497
+ /* @return [Integer] scancode for "F21" key */
498
+ rb_define_const(mScan, "F21", INT2NUM(SDL_SCANCODE_F21));
499
+ /* @return [Integer] scancode for "F22" key */
500
+ rb_define_const(mScan, "F22", INT2NUM(SDL_SCANCODE_F22));
501
+ /* @return [Integer] scancode for "F23" key */
502
+ rb_define_const(mScan, "F23", INT2NUM(SDL_SCANCODE_F23));
503
+ /* @return [Integer] scancode for "F24" key */
504
+ rb_define_const(mScan, "F24", INT2NUM(SDL_SCANCODE_F24));
505
+ /* @return [Integer] scancode for "EXECUTE" key */
506
+ rb_define_const(mScan, "EXECUTE", INT2NUM(SDL_SCANCODE_EXECUTE));
507
+ /* @return [Integer] scancode for "HELP" key */
508
+ rb_define_const(mScan, "HELP", INT2NUM(SDL_SCANCODE_HELP));
509
+ /* @return [Integer] scancode for "MENU" key */
510
+ rb_define_const(mScan, "MENU", INT2NUM(SDL_SCANCODE_MENU));
511
+ /* @return [Integer] scancode for "SELECT" key */
512
+ rb_define_const(mScan, "SELECT", INT2NUM(SDL_SCANCODE_SELECT));
513
+ /* @return [Integer] scancode for "STOP" key */
514
+ rb_define_const(mScan, "STOP", INT2NUM(SDL_SCANCODE_STOP));
515
+ /* @return [Integer] scancode for "AGAIN" key */
516
+ rb_define_const(mScan, "AGAIN", INT2NUM(SDL_SCANCODE_AGAIN));
517
+ /* @return [Integer] scancode for "UNDO" key */
518
+ rb_define_const(mScan, "UNDO", INT2NUM(SDL_SCANCODE_UNDO));
519
+ /* @return [Integer] scancode for "CUT" key */
520
+ rb_define_const(mScan, "CUT", INT2NUM(SDL_SCANCODE_CUT));
521
+ /* @return [Integer] scancode for "COPY" key */
522
+ rb_define_const(mScan, "COPY", INT2NUM(SDL_SCANCODE_COPY));
523
+ /* @return [Integer] scancode for "PASTE" key */
524
+ rb_define_const(mScan, "PASTE", INT2NUM(SDL_SCANCODE_PASTE));
525
+ /* @return [Integer] scancode for "FIND" key */
526
+ rb_define_const(mScan, "FIND", INT2NUM(SDL_SCANCODE_FIND));
527
+ /* @return [Integer] scancode for "MUTE" key */
528
+ rb_define_const(mScan, "MUTE", INT2NUM(SDL_SCANCODE_MUTE));
529
+ /* @return [Integer] scancode for "VOLUMEUP" key */
530
+ rb_define_const(mScan, "VOLUMEUP", INT2NUM(SDL_SCANCODE_VOLUMEUP));
531
+ /* @return [Integer] scancode for "VOLUMEDOWN" key */
532
+ rb_define_const(mScan, "VOLUMEDOWN", INT2NUM(SDL_SCANCODE_VOLUMEDOWN));
533
+ /* not sure whether there's a reason to enable these */
534
+ /* SDL_SCANCODE_LOCKINGCAPSLOCK = 130, */
535
+ /* SDL_SCANCODE_LOCKINGNUMLOCK = 131, */
536
+ /* SDL_SCANCODE_LOCKINGSCROLLLOCK = 132, */
537
+ /* @return [Integer] scancode for "KP_COMMA" key */
538
+ rb_define_const(mScan, "KP_COMMA", INT2NUM(SDL_SCANCODE_KP_COMMA));
539
+ /* @return [Integer] scancode for "KP_EQUALSAS400" key */
540
+ rb_define_const(mScan, "KP_EQUALSAS400", INT2NUM(SDL_SCANCODE_KP_EQUALSAS400));
541
+
542
+ /* @return [Integer] scancode for "INTERNATIONAL1" key */
543
+ rb_define_const(mScan, "INTERNATIONAL1", INT2NUM(SDL_SCANCODE_INTERNATIONAL1));
544
+
545
+ /* @return [Integer] scancode for "INTERNATIONAL2" key */
546
+ rb_define_const(mScan, "INTERNATIONAL2", INT2NUM(SDL_SCANCODE_INTERNATIONAL2));
547
+ /* @return [Integer] scancode for "INTERNATIONAL3" key */
548
+ rb_define_const(mScan, "INTERNATIONAL3", INT2NUM(SDL_SCANCODE_INTERNATIONAL3));
549
+ /* @return [Integer] scancode for "INTERNATIONAL4" key */
550
+ rb_define_const(mScan, "INTERNATIONAL4", INT2NUM(SDL_SCANCODE_INTERNATIONAL4));
551
+ /* @return [Integer] scancode for "INTERNATIONAL5" key */
552
+ rb_define_const(mScan, "INTERNATIONAL5", INT2NUM(SDL_SCANCODE_INTERNATIONAL5));
553
+ /* @return [Integer] scancode for "INTERNATIONAL6" key */
554
+ rb_define_const(mScan, "INTERNATIONAL6", INT2NUM(SDL_SCANCODE_INTERNATIONAL6));
555
+ /* @return [Integer] scancode for "INTERNATIONAL7" key */
556
+ rb_define_const(mScan, "INTERNATIONAL7", INT2NUM(SDL_SCANCODE_INTERNATIONAL7));
557
+ /* @return [Integer] scancode for "INTERNATIONAL8" key */
558
+ rb_define_const(mScan, "INTERNATIONAL8", INT2NUM(SDL_SCANCODE_INTERNATIONAL8));
559
+ /* @return [Integer] scancode for "INTERNATIONAL9" key */
560
+ rb_define_const(mScan, "INTERNATIONAL9", INT2NUM(SDL_SCANCODE_INTERNATIONAL9));
561
+ /* @return [Integer] scancode for "LANG1" key */
562
+ rb_define_const(mScan, "LANG1", INT2NUM(SDL_SCANCODE_LANG1));
563
+ /* @return [Integer] scancode for "LANG2" key */
564
+ rb_define_const(mScan, "LANG2", INT2NUM(SDL_SCANCODE_LANG2));
565
+ /* @return [Integer] scancode for "LANG3" key */
566
+ rb_define_const(mScan, "LANG3", INT2NUM(SDL_SCANCODE_LANG3));
567
+ /* @return [Integer] scancode for "LANG4" key */
568
+ rb_define_const(mScan, "LANG4", INT2NUM(SDL_SCANCODE_LANG4));
569
+ /* @return [Integer] scancode for "LANG5" key */
570
+ rb_define_const(mScan, "LANG5", INT2NUM(SDL_SCANCODE_LANG5));
571
+ /* @return [Integer] scancode for "LANG6" key */
572
+ rb_define_const(mScan, "LANG6", INT2NUM(SDL_SCANCODE_LANG6));
573
+ /* @return [Integer] scancode for "LANG7" key */
574
+ rb_define_const(mScan, "LANG7", INT2NUM(SDL_SCANCODE_LANG7));
575
+ /* @return [Integer] scancode for "LANG8" key */
576
+ rb_define_const(mScan, "LANG8", INT2NUM(SDL_SCANCODE_LANG8));
577
+ /* @return [Integer] scancode for "LANG9" key */
578
+ rb_define_const(mScan, "LANG9", INT2NUM(SDL_SCANCODE_LANG9));
579
+
580
+ /* @return [Integer] scancode for "ALTERASE" key */
581
+ rb_define_const(mScan, "ALTERASE", INT2NUM(SDL_SCANCODE_ALTERASE));
582
+ /* @return [Integer] scancode for "SYSREQ" key */
583
+ rb_define_const(mScan, "SYSREQ", INT2NUM(SDL_SCANCODE_SYSREQ));
584
+ /* @return [Integer] scancode for "CANCEL" key */
585
+ rb_define_const(mScan, "CANCEL", INT2NUM(SDL_SCANCODE_CANCEL));
586
+ /* @return [Integer] scancode for "CLEAR" key */
587
+ rb_define_const(mScan, "CLEAR", INT2NUM(SDL_SCANCODE_CLEAR));
588
+ /* @return [Integer] scancode for "PRIOR" key */
589
+ rb_define_const(mScan, "PRIOR", INT2NUM(SDL_SCANCODE_PRIOR));
590
+ /* @return [Integer] scancode for "RETURN2" key */
591
+ rb_define_const(mScan, "RETURN2", INT2NUM(SDL_SCANCODE_RETURN2));
592
+ /* @return [Integer] scancode for "SEPARATOR" key */
593
+ rb_define_const(mScan, "SEPARATOR", INT2NUM(SDL_SCANCODE_SEPARATOR));
594
+ /* @return [Integer] scancode for "OUT" key */
595
+ rb_define_const(mScan, "OUT", INT2NUM(SDL_SCANCODE_OUT));
596
+ /* @return [Integer] scancode for "OPER" key */
597
+ rb_define_const(mScan, "OPER", INT2NUM(SDL_SCANCODE_OPER));
598
+ /* @return [Integer] scancode for "CLEARAGAIN" key */
599
+ rb_define_const(mScan, "CLEARAGAIN", INT2NUM(SDL_SCANCODE_CLEARAGAIN));
600
+ /* @return [Integer] scancode for "CRSEL" key */
601
+ rb_define_const(mScan, "CRSEL", INT2NUM(SDL_SCANCODE_CRSEL));
602
+ /* @return [Integer] scancode for "EXSEL" key */
603
+ rb_define_const(mScan, "EXSEL", INT2NUM(SDL_SCANCODE_EXSEL));
604
+
605
+ /* @return [Integer] scancode for "KP_00" key */
606
+ rb_define_const(mScan, "KP_00", INT2NUM(SDL_SCANCODE_KP_00));
607
+ /* @return [Integer] scancode for "KP_000" key */
608
+ rb_define_const(mScan, "KP_000", INT2NUM(SDL_SCANCODE_KP_000));
609
+ /* @return [Integer] scancode for "THOUSANDSSEPARATOR" key */
610
+ rb_define_const(mScan, "THOUSANDSSEPARATOR", INT2NUM(SDL_SCANCODE_THOUSANDSSEPARATOR));
611
+ /* @return [Integer] scancode for "DECIMALSEPARATOR" key */
612
+ rb_define_const(mScan, "DECIMALSEPARATOR", INT2NUM(SDL_SCANCODE_DECIMALSEPARATOR));
613
+ /* @return [Integer] scancode for "CURRENCYUNIT" key */
614
+ rb_define_const(mScan, "CURRENCYUNIT", INT2NUM(SDL_SCANCODE_CURRENCYUNIT));
615
+ /* @return [Integer] scancode for "CURRENCYSUBUNIT" key */
616
+ rb_define_const(mScan, "CURRENCYSUBUNIT", INT2NUM(SDL_SCANCODE_CURRENCYSUBUNIT));
617
+ /* @return [Integer] scancode for "KP_LEFTPAREN" key */
618
+ rb_define_const(mScan, "KP_LEFTPAREN", INT2NUM(SDL_SCANCODE_KP_LEFTPAREN));
619
+ /* @return [Integer] scancode for "KP_RIGHTPAREN" key */
620
+ rb_define_const(mScan, "KP_RIGHTPAREN", INT2NUM(SDL_SCANCODE_KP_RIGHTPAREN));
621
+ /* @return [Integer] scancode for "KP_LEFTBRACE" key */
622
+ rb_define_const(mScan, "KP_LEFTBRACE", INT2NUM(SDL_SCANCODE_KP_LEFTBRACE));
623
+ /* @return [Integer] scancode for "KP_RIGHTBRACE" key */
624
+ rb_define_const(mScan, "KP_RIGHTBRACE", INT2NUM(SDL_SCANCODE_KP_RIGHTBRACE));
625
+ /* @return [Integer] scancode for "KP_TAB" key */
626
+ rb_define_const(mScan, "KP_TAB", INT2NUM(SDL_SCANCODE_KP_TAB));
627
+ /* @return [Integer] scancode for "KP_BACKSPACE" key */
628
+ rb_define_const(mScan, "KP_BACKSPACE", INT2NUM(SDL_SCANCODE_KP_BACKSPACE));
629
+ /* @return [Integer] scancode for "KP_A" key */
630
+ rb_define_const(mScan, "KP_A", INT2NUM(SDL_SCANCODE_KP_A));
631
+ /* @return [Integer] scancode for "KP_B" key */
632
+ rb_define_const(mScan, "KP_B", INT2NUM(SDL_SCANCODE_KP_B));
633
+ /* @return [Integer] scancode for "KP_C" key */
634
+ rb_define_const(mScan, "KP_C", INT2NUM(SDL_SCANCODE_KP_C));
635
+ /* @return [Integer] scancode for "KP_D" key */
636
+ rb_define_const(mScan, "KP_D", INT2NUM(SDL_SCANCODE_KP_D));
637
+ /* @return [Integer] scancode for "KP_E" key */
638
+ rb_define_const(mScan, "KP_E", INT2NUM(SDL_SCANCODE_KP_E));
639
+ /* @return [Integer] scancode for "KP_F" key */
640
+ rb_define_const(mScan, "KP_F", INT2NUM(SDL_SCANCODE_KP_F));
641
+ /* @return [Integer] scancode for "KP_XOR" key */
642
+ rb_define_const(mScan, "KP_XOR", INT2NUM(SDL_SCANCODE_KP_XOR));
643
+ /* @return [Integer] scancode for "KP_POWER" key */
644
+ rb_define_const(mScan, "KP_POWER", INT2NUM(SDL_SCANCODE_KP_POWER));
645
+ /* @return [Integer] scancode for "KP_PERCENT" key */
646
+ rb_define_const(mScan, "KP_PERCENT", INT2NUM(SDL_SCANCODE_KP_PERCENT));
647
+ /* @return [Integer] scancode for "KP_LESS" key */
648
+ rb_define_const(mScan, "KP_LESS", INT2NUM(SDL_SCANCODE_KP_LESS));
649
+ /* @return [Integer] scancode for "KP_GREATER" key */
650
+ rb_define_const(mScan, "KP_GREATER", INT2NUM(SDL_SCANCODE_KP_GREATER));
651
+ /* @return [Integer] scancode for "KP_AMPERSAND" key */
652
+ rb_define_const(mScan, "KP_AMPERSAND", INT2NUM(SDL_SCANCODE_KP_AMPERSAND));
653
+ /* @return [Integer] scancode for "KP_DBLAMPERSAND" key */
654
+ rb_define_const(mScan, "KP_DBLAMPERSAND", INT2NUM(SDL_SCANCODE_KP_DBLAMPERSAND));
655
+ /* @return [Integer] scancode for "KP_VERTICALBAR" key */
656
+ rb_define_const(mScan, "KP_VERTICALBAR", INT2NUM(SDL_SCANCODE_KP_VERTICALBAR));
657
+ /* @return [Integer] scancode for "KP_DBLVERTICALBAR" key */
658
+ rb_define_const(mScan, "KP_DBLVERTICALBAR", INT2NUM(SDL_SCANCODE_KP_DBLVERTICALBAR));
659
+ /* @return [Integer] scancode for "KP_COLON" key */
660
+ rb_define_const(mScan, "KP_COLON", INT2NUM(SDL_SCANCODE_KP_COLON));
661
+ /* @return [Integer] scancode for "KP_HASH" key */
662
+ rb_define_const(mScan, "KP_HASH", INT2NUM(SDL_SCANCODE_KP_HASH));
663
+ /* @return [Integer] scancode for "KP_SPACE" key */
664
+ rb_define_const(mScan, "KP_SPACE", INT2NUM(SDL_SCANCODE_KP_SPACE));
665
+ /* @return [Integer] scancode for "KP_AT" key */
666
+ rb_define_const(mScan, "KP_AT", INT2NUM(SDL_SCANCODE_KP_AT));
667
+ /* @return [Integer] scancode for "KP_EXCLAM" key */
668
+ rb_define_const(mScan, "KP_EXCLAM", INT2NUM(SDL_SCANCODE_KP_EXCLAM));
669
+ /* @return [Integer] scancode for "KP_MEMSTORE" key */
670
+ rb_define_const(mScan, "KP_MEMSTORE", INT2NUM(SDL_SCANCODE_KP_MEMSTORE));
671
+ /* @return [Integer] scancode for "KP_MEMRECALL" key */
672
+ rb_define_const(mScan, "KP_MEMRECALL", INT2NUM(SDL_SCANCODE_KP_MEMRECALL));
673
+ /* @return [Integer] scancode for "KP_MEMCLEAR" key */
674
+ rb_define_const(mScan, "KP_MEMCLEAR", INT2NUM(SDL_SCANCODE_KP_MEMCLEAR));
675
+ /* @return [Integer] scancode for "KP_MEMADD" key */
676
+ rb_define_const(mScan, "KP_MEMADD", INT2NUM(SDL_SCANCODE_KP_MEMADD));
677
+ /* @return [Integer] scancode for "KP_MEMSUBTRACT" key */
678
+ rb_define_const(mScan, "KP_MEMSUBTRACT", INT2NUM(SDL_SCANCODE_KP_MEMSUBTRACT));
679
+ /* @return [Integer] scancode for "KP_MEMMULTIPLY" key */
680
+ rb_define_const(mScan, "KP_MEMMULTIPLY", INT2NUM(SDL_SCANCODE_KP_MEMMULTIPLY));
681
+ /* @return [Integer] scancode for "KP_MEMDIVIDE" key */
682
+ rb_define_const(mScan, "KP_MEMDIVIDE", INT2NUM(SDL_SCANCODE_KP_MEMDIVIDE));
683
+ /* @return [Integer] scancode for "KP_PLUSMINUS" key */
684
+ rb_define_const(mScan, "KP_PLUSMINUS", INT2NUM(SDL_SCANCODE_KP_PLUSMINUS));
685
+ /* @return [Integer] scancode for "KP_CLEAR" key */
686
+ rb_define_const(mScan, "KP_CLEAR", INT2NUM(SDL_SCANCODE_KP_CLEAR));
687
+ /* @return [Integer] scancode for "KP_CLEARENTRY" key */
688
+ rb_define_const(mScan, "KP_CLEARENTRY", INT2NUM(SDL_SCANCODE_KP_CLEARENTRY));
689
+ /* @return [Integer] scancode for "KP_BINARY" key */
690
+ rb_define_const(mScan, "KP_BINARY", INT2NUM(SDL_SCANCODE_KP_BINARY));
691
+ /* @return [Integer] scancode for "KP_OCTAL" key */
692
+ rb_define_const(mScan, "KP_OCTAL", INT2NUM(SDL_SCANCODE_KP_OCTAL));
693
+ /* @return [Integer] scancode for "KP_DECIMAL" key */
694
+ rb_define_const(mScan, "KP_DECIMAL", INT2NUM(SDL_SCANCODE_KP_DECIMAL));
695
+ /* @return [Integer] scancode for "KP_HEXADECIMAL" key */
696
+ rb_define_const(mScan, "KP_HEXADECIMAL", INT2NUM(SDL_SCANCODE_KP_HEXADECIMAL));
697
+
698
+ /* @return [Integer] scancode for "LCTRL" key */
699
+ rb_define_const(mScan, "LCTRL", INT2NUM(SDL_SCANCODE_LCTRL));
700
+ /* @return [Integer] scancode for "LSHIFT" key */
701
+ rb_define_const(mScan, "LSHIFT", INT2NUM(SDL_SCANCODE_LSHIFT));
702
+ /* @return [Integer] scancode for "LALT" key */
703
+ rb_define_const(mScan, "LALT", INT2NUM(SDL_SCANCODE_LALT));
704
+ /* @return [Integer] scancode for "LGUI" key */
705
+ rb_define_const(mScan, "LGUI", INT2NUM(SDL_SCANCODE_LGUI));
706
+ /* @return [Integer] scancode for "RCTRL" key */
707
+ rb_define_const(mScan, "RCTRL", INT2NUM(SDL_SCANCODE_RCTRL));
708
+ /* @return [Integer] scancode for "RSHIFT" key */
709
+ rb_define_const(mScan, "RSHIFT", INT2NUM(SDL_SCANCODE_RSHIFT));
710
+ /* @return [Integer] scancode for "RALT" key */
711
+ rb_define_const(mScan, "RALT", INT2NUM(SDL_SCANCODE_RALT));
712
+ /* @return [Integer] scancode for "RGUI" key */
713
+ rb_define_const(mScan, "RGUI", INT2NUM(SDL_SCANCODE_RGUI));
714
+
715
+ /* @return [Integer] scancode for "MODE" key */
716
+ rb_define_const(mScan, "MODE", INT2NUM(SDL_SCANCODE_MODE));
717
+
718
+ /* @return [Integer] scancode for "AUDIONEXT" key */
719
+ rb_define_const(mScan, "AUDIONEXT", INT2NUM(SDL_SCANCODE_AUDIONEXT));
720
+ /* @return [Integer] scancode for "AUDIOPREV" key */
721
+ rb_define_const(mScan, "AUDIOPREV", INT2NUM(SDL_SCANCODE_AUDIOPREV));
722
+ /* @return [Integer] scancode for "AUDIOSTOP" key */
723
+ rb_define_const(mScan, "AUDIOSTOP", INT2NUM(SDL_SCANCODE_AUDIOSTOP));
724
+ /* @return [Integer] scancode for "AUDIOPLAY" key */
725
+ rb_define_const(mScan, "AUDIOPLAY", INT2NUM(SDL_SCANCODE_AUDIOPLAY));
726
+ /* @return [Integer] scancode for "AUDIOMUTE" key */
727
+ rb_define_const(mScan, "AUDIOMUTE", INT2NUM(SDL_SCANCODE_AUDIOMUTE));
728
+ /* @return [Integer] scancode for "MEDIASELECT" key */
729
+ rb_define_const(mScan, "MEDIASELECT", INT2NUM(SDL_SCANCODE_MEDIASELECT));
730
+ /* @return [Integer] scancode for "WWW" key */
731
+ rb_define_const(mScan, "WWW", INT2NUM(SDL_SCANCODE_WWW));
732
+ /* @return [Integer] scancode for "MAIL" key */
733
+ rb_define_const(mScan, "MAIL", INT2NUM(SDL_SCANCODE_MAIL));
734
+ /* @return [Integer] scancode for "CALCULATOR" key */
735
+ rb_define_const(mScan, "CALCULATOR", INT2NUM(SDL_SCANCODE_CALCULATOR));
736
+ /* @return [Integer] scancode for "COMPUTER" key */
737
+ rb_define_const(mScan, "COMPUTER", INT2NUM(SDL_SCANCODE_COMPUTER));
738
+ /* @return [Integer] scancode for "AC_SEARCH" key */
739
+ rb_define_const(mScan, "AC_SEARCH", INT2NUM(SDL_SCANCODE_AC_SEARCH));
740
+ /* @return [Integer] scancode for "AC_HOME" key */
741
+ rb_define_const(mScan, "AC_HOME", INT2NUM(SDL_SCANCODE_AC_HOME));
742
+ /* @return [Integer] scancode for "AC_BACK" key */
743
+ rb_define_const(mScan, "AC_BACK", INT2NUM(SDL_SCANCODE_AC_BACK));
744
+ /* @return [Integer] scancode for "AC_FORWARD" key */
745
+ rb_define_const(mScan, "AC_FORWARD", INT2NUM(SDL_SCANCODE_AC_FORWARD));
746
+ /* @return [Integer] scancode for "AC_STOP" key */
747
+ rb_define_const(mScan, "AC_STOP", INT2NUM(SDL_SCANCODE_AC_STOP));
748
+ /* @return [Integer] scancode for "AC_REFRESH" key */
749
+ rb_define_const(mScan, "AC_REFRESH", INT2NUM(SDL_SCANCODE_AC_REFRESH));
750
+ /* @return [Integer] scancode for "AC_BOOKMARKS" key */
751
+ rb_define_const(mScan, "AC_BOOKMARKS", INT2NUM(SDL_SCANCODE_AC_BOOKMARKS));
752
+
753
+ /* @return [Integer] scancode for "BRIGHTNESSDOWN" key */
754
+ rb_define_const(mScan, "BRIGHTNESSDOWN", INT2NUM(SDL_SCANCODE_BRIGHTNESSDOWN));
755
+ /* @return [Integer] scancode for "BRIGHTNESSUP" key */
756
+ rb_define_const(mScan, "BRIGHTNESSUP", INT2NUM(SDL_SCANCODE_BRIGHTNESSUP));
757
+ /* @return [Integer] scancode for "DISPLAYSWITCH" key */
758
+ rb_define_const(mScan, "DISPLAYSWITCH", INT2NUM(SDL_SCANCODE_DISPLAYSWITCH));
759
+
760
+ /* @return [Integer] scancode for "KBDILLUMTOGGLE" key */
761
+ rb_define_const(mScan, "KBDILLUMTOGGLE", INT2NUM(SDL_SCANCODE_KBDILLUMTOGGLE));
762
+ /* @return [Integer] scancode for "KBDILLUMDOWN" key */
763
+ rb_define_const(mScan, "KBDILLUMDOWN", INT2NUM(SDL_SCANCODE_KBDILLUMDOWN));
764
+ /* @return [Integer] scancode for "KBDILLUMUP" key */
765
+ rb_define_const(mScan, "KBDILLUMUP", INT2NUM(SDL_SCANCODE_KBDILLUMUP));
766
+ /* @return [Integer] scancode for "EJECT" key */
767
+ rb_define_const(mScan, "EJECT", INT2NUM(SDL_SCANCODE_EJECT));
768
+ /* @return [Integer] scancode for "SLEEP" key */
769
+ rb_define_const(mScan, "SLEEP", INT2NUM(SDL_SCANCODE_SLEEP));
770
+
771
+ /* @return [Integer] scancode for "APP1" key */
772
+ rb_define_const(mScan, "APP1", INT2NUM(SDL_SCANCODE_APP1));
773
+ /* @return [Integer] scancode for "APP2" key */
774
+ rb_define_const(mScan, "APP2", INT2NUM(SDL_SCANCODE_APP2));
775
+
776
+ /* @return [Integer] unused keycode */
777
+ rb_define_const(mKey, "UNKNOWN", INT2NUM(SDLK_UNKNOWN));
778
+ /* @return [Integer] keycode for "RETURN" key */
779
+ rb_define_const(mKey, "RETURN", INT2NUM(SDLK_RETURN));
780
+ /* @return [Integer] keycode for "ESCAPE" key */
781
+ rb_define_const(mKey, "ESCAPE", INT2NUM(SDLK_ESCAPE));
782
+ /* @return [Integer] keycode for "BACKSPACE" key */
783
+ rb_define_const(mKey, "BACKSPACE", INT2NUM(SDLK_BACKSPACE));
784
+ /* @return [Integer] keycode for "TAB" key */
785
+ rb_define_const(mKey, "TAB", INT2NUM(SDLK_TAB));
786
+ /* @return [Integer] keycode for "SPACE" key */
787
+ rb_define_const(mKey, "SPACE", INT2NUM(SDLK_SPACE));
788
+ /* @return [Integer] keycode for "EXCLAIM" key */
789
+ rb_define_const(mKey, "EXCLAIM", INT2NUM(SDLK_EXCLAIM));
790
+ /* @return [Integer] keycode for "QUOTEDBL" key */
791
+ rb_define_const(mKey, "QUOTEDBL", INT2NUM(SDLK_QUOTEDBL));
792
+ /* @return [Integer] keycode for "HASH" key */
793
+ rb_define_const(mKey, "HASH", INT2NUM(SDLK_HASH));
794
+ /* @return [Integer] keycode for "PERCENT" key */
795
+ rb_define_const(mKey, "PERCENT", INT2NUM(SDLK_PERCENT));
796
+ /* @return [Integer] keycode for "DOLLAR" key */
797
+ rb_define_const(mKey, "DOLLAR", INT2NUM(SDLK_DOLLAR));
798
+ /* @return [Integer] keycode for "AMPERSAND" key */
799
+ rb_define_const(mKey, "AMPERSAND", INT2NUM(SDLK_AMPERSAND));
800
+ /* @return [Integer] keycode for "QUOTE" key */
801
+ rb_define_const(mKey, "QUOTE", INT2NUM(SDLK_QUOTE));
802
+ /* @return [Integer] keycode for "LEFTPAREN" key */
803
+ rb_define_const(mKey, "LEFTPAREN", INT2NUM(SDLK_LEFTPAREN));
804
+ /* @return [Integer] keycode for "RIGHTPAREN" key */
805
+ rb_define_const(mKey, "RIGHTPAREN", INT2NUM(SDLK_RIGHTPAREN));
806
+ /* @return [Integer] keycode for "ASTERISK" key */
807
+ rb_define_const(mKey, "ASTERISK", INT2NUM(SDLK_ASTERISK));
808
+ /* @return [Integer] keycode for "PLUS" key */
809
+ rb_define_const(mKey, "PLUS", INT2NUM(SDLK_PLUS));
810
+ /* @return [Integer] keycode for "COMMA" key */
811
+ rb_define_const(mKey, "COMMA", INT2NUM(SDLK_COMMA));
812
+ /* @return [Integer] keycode for "MINUS" key */
813
+ rb_define_const(mKey, "MINUS", INT2NUM(SDLK_MINUS));
814
+ /* @return [Integer] keycode for "PERIOD" key */
815
+ rb_define_const(mKey, "PERIOD", INT2NUM(SDLK_PERIOD));
816
+ /* @return [Integer] keycode for "SLASH" key */
817
+ rb_define_const(mKey, "SLASH", INT2NUM(SDLK_SLASH));
818
+ /* @return [Integer] keycode for number key "0" (not on keypad) */
819
+ rb_define_const(mKey, "K0", INT2NUM(SDLK_0));
820
+ /* @return [Integer] keycode for number key "1" (not on keypad) */
821
+ rb_define_const(mKey, "K1", INT2NUM(SDLK_1));
822
+ /* @return [Integer] keycode for number key "2" (not on keypad) */
823
+ rb_define_const(mKey, "K2", INT2NUM(SDLK_2));
824
+ /* @return [Integer] keycode for number key "3" (not on keypad) */
825
+ rb_define_const(mKey, "K3", INT2NUM(SDLK_3));
826
+ /* @return [Integer] keycode for number key "4" (not on keypad) */
827
+ rb_define_const(mKey, "K4", INT2NUM(SDLK_4));
828
+ /* @return [Integer] keycode for number key "5" (not on keypad) */
829
+ rb_define_const(mKey, "K5", INT2NUM(SDLK_5));
830
+ /* @return [Integer] keycode for number key "6" (not on keypad) */
831
+ rb_define_const(mKey, "K6", INT2NUM(SDLK_6));
832
+ /* @return [Integer] keycode for number key "7" (not on keypad) */
833
+ rb_define_const(mKey, "K7", INT2NUM(SDLK_7));
834
+ /* @return [Integer] keycode for number key "8" (not on keypad) */
835
+ rb_define_const(mKey, "K8", INT2NUM(SDLK_8));
836
+ /* @return [Integer] keycode for number key "9" (not on keypad) */
837
+ rb_define_const(mKey, "K9", INT2NUM(SDLK_9));
838
+ /* @return [Integer] keycode for "COLON" key */
839
+ rb_define_const(mKey, "COLON", INT2NUM(SDLK_COLON));
840
+ /* @return [Integer] keycode for "SEMICOLON" key */
841
+ rb_define_const(mKey, "SEMICOLON", INT2NUM(SDLK_SEMICOLON));
842
+ /* @return [Integer] keycode for "LESS" key */
843
+ rb_define_const(mKey, "LESS", INT2NUM(SDLK_LESS));
844
+ /* @return [Integer] keycode for "EQUALS" key */
845
+ rb_define_const(mKey, "EQUALS", INT2NUM(SDLK_EQUALS));
846
+ /* @return [Integer] keycode for "GREATER" key */
847
+ rb_define_const(mKey, "GREATER", INT2NUM(SDLK_GREATER));
848
+ /* @return [Integer] keycode for "QUESTION" key */
849
+ rb_define_const(mKey, "QUESTION", INT2NUM(SDLK_QUESTION));
850
+ /* @return [Integer] keycode for "AT" key */
851
+ rb_define_const(mKey, "AT", INT2NUM(SDLK_AT));
852
+ /*
853
+ Skip uppercase letters
854
+ */
855
+ /* @return [Integer] keycode for "LEFTBRACKET" key */
856
+ rb_define_const(mKey, "LEFTBRACKET", INT2NUM(SDLK_LEFTBRACKET));
857
+ /* @return [Integer] keycode for "BACKSLASH" key */
858
+ rb_define_const(mKey, "BACKSLASH", INT2NUM(SDLK_BACKSLASH));
859
+ /* @return [Integer] keycode for "RIGHTBRACKET" key */
860
+ rb_define_const(mKey, "RIGHTBRACKET", INT2NUM(SDLK_RIGHTBRACKET));
861
+ /* @return [Integer] keycode for "CARET" key */
862
+ rb_define_const(mKey, "CARET", INT2NUM(SDLK_CARET));
863
+ /* @return [Integer] keycode for "UNDERSCORE" key */
864
+ rb_define_const(mKey, "UNDERSCORE", INT2NUM(SDLK_UNDERSCORE));
865
+ /* @return [Integer] keycode for "BACKQUOTE" key */
866
+ rb_define_const(mKey, "BACKQUOTE", INT2NUM(SDLK_BACKQUOTE));
867
+
868
+ /* @return [Integer] keycode for alphabet key "a" */
869
+ rb_define_const(mKey, "A", INT2NUM(SDLK_a));
870
+ /* @return [Integer] keycode for alphabet key "b" */
871
+ rb_define_const(mKey, "B", INT2NUM(SDLK_b));
872
+ /* @return [Integer] keycode for alphabet key "c" */
873
+ rb_define_const(mKey, "C", INT2NUM(SDLK_c));
874
+ /* @return [Integer] keycode for alphabet key "d" */
875
+ rb_define_const(mKey, "D", INT2NUM(SDLK_d));
876
+ /* @return [Integer] keycode for alphabet key "e" */
877
+ rb_define_const(mKey, "E", INT2NUM(SDLK_e));
878
+ /* @return [Integer] keycode for alphabet key "f" */
879
+ rb_define_const(mKey, "F", INT2NUM(SDLK_f));
880
+ /* @return [Integer] keycode for alphabet key "g" */
881
+ rb_define_const(mKey, "G", INT2NUM(SDLK_g));
882
+ /* @return [Integer] keycode for alphabet key "h" */
883
+ rb_define_const(mKey, "H", INT2NUM(SDLK_h));
884
+ /* @return [Integer] keycode for alphabet key "i" */
885
+ rb_define_const(mKey, "I", INT2NUM(SDLK_i));
886
+ /* @return [Integer] keycode for alphabet key "j" */
887
+ rb_define_const(mKey, "J", INT2NUM(SDLK_j));
888
+ /* @return [Integer] keycode for alphabet key "k" */
889
+ rb_define_const(mKey, "K", INT2NUM(SDLK_k));
890
+ /* @return [Integer] keycode for alphabet key "l" */
891
+ rb_define_const(mKey, "L", INT2NUM(SDLK_l));
892
+ /* @return [Integer] keycode for alphabet key "m" */
893
+ rb_define_const(mKey, "M", INT2NUM(SDLK_m));
894
+ /* @return [Integer] keycode for alphabet key "n" */
895
+ rb_define_const(mKey, "N", INT2NUM(SDLK_n));
896
+ /* @return [Integer] keycode for alphabet key "o" */
897
+ rb_define_const(mKey, "O", INT2NUM(SDLK_o));
898
+ /* @return [Integer] keycode for alphabet key "p" */
899
+ rb_define_const(mKey, "P", INT2NUM(SDLK_p));
900
+ /* @return [Integer] keycode for alphabet key "q" */
901
+ rb_define_const(mKey, "Q", INT2NUM(SDLK_q));
902
+ /* @return [Integer] keycode for alphabet key "r" */
903
+ rb_define_const(mKey, "R", INT2NUM(SDLK_r));
904
+ /* @return [Integer] keycode for alphabet key "s" */
905
+ rb_define_const(mKey, "S", INT2NUM(SDLK_s));
906
+ /* @return [Integer] keycode for alphabet key "t" */
907
+ rb_define_const(mKey, "T", INT2NUM(SDLK_t));
908
+ /* @return [Integer] keycode for alphabet key "u" */
909
+ rb_define_const(mKey, "U", INT2NUM(SDLK_u));
910
+ /* @return [Integer] keycode for alphabet key "v" */
911
+ rb_define_const(mKey, "V", INT2NUM(SDLK_v));
912
+ /* @return [Integer] keycode for alphabet key "w" */
913
+ rb_define_const(mKey, "W", INT2NUM(SDLK_w));
914
+ /* @return [Integer] keycode for alphabet key "x" */
915
+ rb_define_const(mKey, "X", INT2NUM(SDLK_x));
916
+ /* @return [Integer] keycode for alphabet key "y" */
917
+ rb_define_const(mKey, "Y", INT2NUM(SDLK_y));
918
+ /* @return [Integer] keycode for alphabet key "z" */
919
+ rb_define_const(mKey, "Z", INT2NUM(SDLK_z));
920
+
921
+ /* @return [Integer] keycode for "CAPSLOCK" key */
922
+ rb_define_const(mKey, "CAPSLOCK", INT2NUM(SDLK_CAPSLOCK));
923
+
924
+ /* @return [Integer] keycode for "F1" key */
925
+ rb_define_const(mKey, "F1", INT2NUM(SDLK_F1));
926
+ /* @return [Integer] keycode for "F2" key */
927
+ rb_define_const(mKey, "F2", INT2NUM(SDLK_F2));
928
+ /* @return [Integer] keycode for "F3" key */
929
+ rb_define_const(mKey, "F3", INT2NUM(SDLK_F3));
930
+ /* @return [Integer] keycode for "F4" key */
931
+ rb_define_const(mKey, "F4", INT2NUM(SDLK_F4));
932
+ /* @return [Integer] keycode for "F5" key */
933
+ rb_define_const(mKey, "F5", INT2NUM(SDLK_F5));
934
+ /* @return [Integer] keycode for "F6" key */
935
+ rb_define_const(mKey, "F6", INT2NUM(SDLK_F6));
936
+ /* @return [Integer] keycode for "F7" key */
937
+ rb_define_const(mKey, "F7", INT2NUM(SDLK_F7));
938
+ /* @return [Integer] keycode for "F8" key */
939
+ rb_define_const(mKey, "F8", INT2NUM(SDLK_F8));
940
+ /* @return [Integer] keycode for "F9" key */
941
+ rb_define_const(mKey, "F9", INT2NUM(SDLK_F9));
942
+ /* @return [Integer] keycode for "F10" key */
943
+ rb_define_const(mKey, "F10", INT2NUM(SDLK_F10));
944
+ /* @return [Integer] keycode for "F11" key */
945
+ rb_define_const(mKey, "F11", INT2NUM(SDLK_F11));
946
+ /* @return [Integer] keycode for "F12" key */
947
+ rb_define_const(mKey, "F12", INT2NUM(SDLK_F12));
948
+
949
+ /* @return [Integer] keycode for "PRINTSCREEN" key */
950
+ rb_define_const(mKey, "PRINTSCREEN", INT2NUM(SDLK_PRINTSCREEN));
951
+ /* @return [Integer] keycode for "SCROLLLOCK" key */
952
+ rb_define_const(mKey, "SCROLLLOCK", INT2NUM(SDLK_SCROLLLOCK));
953
+ /* @return [Integer] keycode for "PAUSE" key */
954
+ rb_define_const(mKey, "PAUSE", INT2NUM(SDLK_PAUSE));
955
+ /* @return [Integer] keycode for "INSERT" key */
956
+ rb_define_const(mKey, "INSERT", INT2NUM(SDLK_INSERT));
957
+ /* @return [Integer] keycode for "HOME" key */
958
+ rb_define_const(mKey, "HOME", INT2NUM(SDLK_HOME));
959
+ /* @return [Integer] keycode for "PAGEUP" key */
960
+ rb_define_const(mKey, "PAGEUP", INT2NUM(SDLK_PAGEUP));
961
+ /* @return [Integer] keycode for "DELETE" key */
962
+ rb_define_const(mKey, "DELETE", INT2NUM(SDLK_DELETE));
963
+ /* @return [Integer] keycode for "END" key */
964
+ rb_define_const(mKey, "END", INT2NUM(SDLK_END));
965
+ /* @return [Integer] keycode for "PAGEDOWN" key */
966
+ rb_define_const(mKey, "PAGEDOWN", INT2NUM(SDLK_PAGEDOWN));
967
+ /* @return [Integer] keycode for "RIGHT" key */
968
+ rb_define_const(mKey, "RIGHT", INT2NUM(SDLK_RIGHT));
969
+ /* @return [Integer] keycode for "LEFT" key */
970
+ rb_define_const(mKey, "LEFT", INT2NUM(SDLK_LEFT));
971
+ /* @return [Integer] keycode for "DOWN" key */
972
+ rb_define_const(mKey, "DOWN", INT2NUM(SDLK_DOWN));
973
+ /* @return [Integer] keycode for "UP" key */
974
+ rb_define_const(mKey, "UP", INT2NUM(SDLK_UP));
975
+
976
+ /* @return [Integer] keycode for "NUMLOCKCLEAR" key */
977
+ rb_define_const(mKey, "NUMLOCKCLEAR", INT2NUM(SDLK_NUMLOCKCLEAR));
978
+ /* @return [Integer] keycode for "KP_DIVIDE" key */
979
+ rb_define_const(mKey, "KP_DIVIDE", INT2NUM(SDLK_KP_DIVIDE));
980
+ /* @return [Integer] keycode for "KP_MULTIPLY" key */
981
+ rb_define_const(mKey, "KP_MULTIPLY", INT2NUM(SDLK_KP_MULTIPLY));
982
+ /* @return [Integer] keycode for "KP_MINUS" key */
983
+ rb_define_const(mKey, "KP_MINUS", INT2NUM(SDLK_KP_MINUS));
984
+ /* @return [Integer] keycode for "KP_PLUS" key */
985
+ rb_define_const(mKey, "KP_PLUS", INT2NUM(SDLK_KP_PLUS));
986
+ /* @return [Integer] keycode for "KP_ENTER" key */
987
+ rb_define_const(mKey, "KP_ENTER", INT2NUM(SDLK_KP_ENTER));
988
+ /* @return [Integer] keycode for "KP_1" key */
989
+ rb_define_const(mKey, "KP_1", INT2NUM(SDLK_KP_1));
990
+ /* @return [Integer] keycode for "KP_2" key */
991
+ rb_define_const(mKey, "KP_2", INT2NUM(SDLK_KP_2));
992
+ /* @return [Integer] keycode for "KP_3" key */
993
+ rb_define_const(mKey, "KP_3", INT2NUM(SDLK_KP_3));
994
+ /* @return [Integer] keycode for "KP_4" key */
995
+ rb_define_const(mKey, "KP_4", INT2NUM(SDLK_KP_4));
996
+ /* @return [Integer] keycode for "KP_5" key */
997
+ rb_define_const(mKey, "KP_5", INT2NUM(SDLK_KP_5));
998
+ /* @return [Integer] keycode for "KP_6" key */
999
+ rb_define_const(mKey, "KP_6", INT2NUM(SDLK_KP_6));
1000
+ /* @return [Integer] keycode for "KP_7" key */
1001
+ rb_define_const(mKey, "KP_7", INT2NUM(SDLK_KP_7));
1002
+ /* @return [Integer] keycode for "KP_8" key */
1003
+ rb_define_const(mKey, "KP_8", INT2NUM(SDLK_KP_8));
1004
+ /* @return [Integer] keycode for "KP_9" key */
1005
+ rb_define_const(mKey, "KP_9", INT2NUM(SDLK_KP_9));
1006
+ /* @return [Integer] keycode for "KP_0" key */
1007
+ rb_define_const(mKey, "KP_0", INT2NUM(SDLK_KP_0));
1008
+ /* @return [Integer] keycode for "KP_PERIOD" key */
1009
+ rb_define_const(mKey, "KP_PERIOD", INT2NUM(SDLK_KP_PERIOD));
1010
+
1011
+ /* @return [Integer] keycode for "APPLICATION" key */
1012
+ rb_define_const(mKey, "APPLICATION", INT2NUM(SDLK_APPLICATION));
1013
+ /* @return [Integer] keycode for "POWER" key */
1014
+ rb_define_const(mKey, "POWER", INT2NUM(SDLK_POWER));
1015
+ /* @return [Integer] keycode for "KP_EQUALS" key */
1016
+ rb_define_const(mKey, "KP_EQUALS", INT2NUM(SDLK_KP_EQUALS));
1017
+ /* @return [Integer] keycode for "F13" key */
1018
+ rb_define_const(mKey, "F13", INT2NUM(SDLK_F13));
1019
+ /* @return [Integer] keycode for "F14" key */
1020
+ rb_define_const(mKey, "F14", INT2NUM(SDLK_F14));
1021
+ /* @return [Integer] keycode for "F15" key */
1022
+ rb_define_const(mKey, "F15", INT2NUM(SDLK_F15));
1023
+ /* @return [Integer] keycode for "F16" key */
1024
+ rb_define_const(mKey, "F16", INT2NUM(SDLK_F16));
1025
+ /* @return [Integer] keycode for "F17" key */
1026
+ rb_define_const(mKey, "F17", INT2NUM(SDLK_F17));
1027
+ /* @return [Integer] keycode for "F18" key */
1028
+ rb_define_const(mKey, "F18", INT2NUM(SDLK_F18));
1029
+ /* @return [Integer] keycode for "F19" key */
1030
+ rb_define_const(mKey, "F19", INT2NUM(SDLK_F19));
1031
+ /* @return [Integer] keycode for "F20" key */
1032
+ rb_define_const(mKey, "F20", INT2NUM(SDLK_F20));
1033
+ /* @return [Integer] keycode for "F21" key */
1034
+ rb_define_const(mKey, "F21", INT2NUM(SDLK_F21));
1035
+ /* @return [Integer] keycode for "F22" key */
1036
+ rb_define_const(mKey, "F22", INT2NUM(SDLK_F22));
1037
+ /* @return [Integer] keycode for "F23" key */
1038
+ rb_define_const(mKey, "F23", INT2NUM(SDLK_F23));
1039
+ /* @return [Integer] keycode for "F24" key */
1040
+ rb_define_const(mKey, "F24", INT2NUM(SDLK_F24));
1041
+ /* @return [Integer] keycode for "EXECUTE" key */
1042
+ rb_define_const(mKey, "EXECUTE", INT2NUM(SDLK_EXECUTE));
1043
+ /* @return [Integer] keycode for "HELP" key */
1044
+ rb_define_const(mKey, "HELP", INT2NUM(SDLK_HELP));
1045
+ /* @return [Integer] keycode for "MENU" key */
1046
+ rb_define_const(mKey, "MENU", INT2NUM(SDLK_MENU));
1047
+ /* @return [Integer] keycode for "SELECT" key */
1048
+ rb_define_const(mKey, "SELECT", INT2NUM(SDLK_SELECT));
1049
+ /* @return [Integer] keycode for "STOP" key */
1050
+ rb_define_const(mKey, "STOP", INT2NUM(SDLK_STOP));
1051
+ /* @return [Integer] keycode for "AGAIN" key */
1052
+ rb_define_const(mKey, "AGAIN", INT2NUM(SDLK_AGAIN));
1053
+ /* @return [Integer] keycode for "UNDO" key */
1054
+ rb_define_const(mKey, "UNDO", INT2NUM(SDLK_UNDO));
1055
+ /* @return [Integer] keycode for "CUT" key */
1056
+ rb_define_const(mKey, "CUT", INT2NUM(SDLK_CUT));
1057
+ /* @return [Integer] keycode for "COPY" key */
1058
+ rb_define_const(mKey, "COPY", INT2NUM(SDLK_COPY));
1059
+ /* @return [Integer] keycode for "PASTE" key */
1060
+ rb_define_const(mKey, "PASTE", INT2NUM(SDLK_PASTE));
1061
+ /* @return [Integer] keycode for "FIND" key */
1062
+ rb_define_const(mKey, "FIND", INT2NUM(SDLK_FIND));
1063
+ /* @return [Integer] keycode for "MUTE" key */
1064
+ rb_define_const(mKey, "MUTE", INT2NUM(SDLK_MUTE));
1065
+ /* @return [Integer] keycode for "VOLUMEUP" key */
1066
+ rb_define_const(mKey, "VOLUMEUP", INT2NUM(SDLK_VOLUMEUP));
1067
+ /* @return [Integer] keycode for "VOLUMEDOWN" key */
1068
+ rb_define_const(mKey, "VOLUMEDOWN", INT2NUM(SDLK_VOLUMEDOWN));
1069
+ /* @return [Integer] keycode for "KP_COMMA" key */
1070
+ rb_define_const(mKey, "KP_COMMA", INT2NUM(SDLK_KP_COMMA));
1071
+ /* @return [Integer] keycode for "KP_EQUALSAS400" key */
1072
+ rb_define_const(mKey, "KP_EQUALSAS400", INT2NUM(SDLK_KP_EQUALSAS400));
1073
+
1074
+ /* @return [Integer] keycode for "ALTERASE" key */
1075
+ rb_define_const(mKey, "ALTERASE", INT2NUM(SDLK_ALTERASE));
1076
+ /* @return [Integer] keycode for "SYSREQ" key */
1077
+ rb_define_const(mKey, "SYSREQ", INT2NUM(SDLK_SYSREQ));
1078
+ /* @return [Integer] keycode for "CANCEL" key */
1079
+ rb_define_const(mKey, "CANCEL", INT2NUM(SDLK_CANCEL));
1080
+ /* @return [Integer] keycode for "CLEAR" key */
1081
+ rb_define_const(mKey, "CLEAR", INT2NUM(SDLK_CLEAR));
1082
+ /* @return [Integer] keycode for "PRIOR" key */
1083
+ rb_define_const(mKey, "PRIOR", INT2NUM(SDLK_PRIOR));
1084
+ /* @return [Integer] keycode for "RETURN2" key */
1085
+ rb_define_const(mKey, "RETURN2", INT2NUM(SDLK_RETURN2));
1086
+ /* @return [Integer] keycode for "SEPARATOR" key */
1087
+ rb_define_const(mKey, "SEPARATOR", INT2NUM(SDLK_SEPARATOR));
1088
+ /* @return [Integer] keycode for "OUT" key */
1089
+ rb_define_const(mKey, "OUT", INT2NUM(SDLK_OUT));
1090
+ /* @return [Integer] keycode for "OPER" key */
1091
+ rb_define_const(mKey, "OPER", INT2NUM(SDLK_OPER));
1092
+ /* @return [Integer] keycode for "CLEARAGAIN" key */
1093
+ rb_define_const(mKey, "CLEARAGAIN", INT2NUM(SDLK_CLEARAGAIN));
1094
+ /* @return [Integer] keycode for "CRSEL" key */
1095
+ rb_define_const(mKey, "CRSEL", INT2NUM(SDLK_CRSEL));
1096
+ /* @return [Integer] keycode for "EXSEL" key */
1097
+ rb_define_const(mKey, "EXSEL", INT2NUM(SDLK_EXSEL));
1098
+
1099
+ /* @return [Integer] keycode for "KP_00" key */
1100
+ rb_define_const(mKey, "KP_00", INT2NUM(SDLK_KP_00));
1101
+ /* @return [Integer] keycode for "KP_000" key */
1102
+ rb_define_const(mKey, "KP_000", INT2NUM(SDLK_KP_000));
1103
+ /* @return [Integer] keycode for "THOUSANDSSEPARATOR" key */
1104
+ rb_define_const(mKey, "THOUSANDSSEPARATOR", INT2NUM(SDLK_THOUSANDSSEPARATOR));
1105
+
1106
+ /* @return [Integer] keycode for "DECIMALSEPARATOR" key */
1107
+ rb_define_const(mKey, "DECIMALSEPARATOR", INT2NUM(SDLK_DECIMALSEPARATOR));
1108
+
1109
+ /* @return [Integer] keycode for "CURRENCYUNIT" key */
1110
+ rb_define_const(mKey, "CURRENCYUNIT", INT2NUM(SDLK_CURRENCYUNIT));
1111
+ /* @return [Integer] keycode for "CURRENCYSUBUNIT" key */
1112
+ rb_define_const(mKey, "CURRENCYSUBUNIT", INT2NUM(SDLK_CURRENCYSUBUNIT));
1113
+ /* @return [Integer] keycode for "KP_LEFTPAREN" key */
1114
+ rb_define_const(mKey, "KP_LEFTPAREN", INT2NUM(SDLK_KP_LEFTPAREN));
1115
+ /* @return [Integer] keycode for "KP_RIGHTPAREN" key */
1116
+ rb_define_const(mKey, "KP_RIGHTPAREN", INT2NUM(SDLK_KP_RIGHTPAREN));
1117
+ /* @return [Integer] keycode for "KP_LEFTBRACE" key */
1118
+ rb_define_const(mKey, "KP_LEFTBRACE", INT2NUM(SDLK_KP_LEFTBRACE));
1119
+ /* @return [Integer] keycode for "KP_RIGHTBRACE" key */
1120
+ rb_define_const(mKey, "KP_RIGHTBRACE", INT2NUM(SDLK_KP_RIGHTBRACE));
1121
+ /* @return [Integer] keycode for "KP_TAB" key */
1122
+ rb_define_const(mKey, "KP_TAB", INT2NUM(SDLK_KP_TAB));
1123
+ /* @return [Integer] keycode for "KP_BACKSPACE" key */
1124
+ rb_define_const(mKey, "KP_BACKSPACE", INT2NUM(SDLK_KP_BACKSPACE));
1125
+ /* @return [Integer] keycode for "KP_A" key */
1126
+ rb_define_const(mKey, "KP_A", INT2NUM(SDLK_KP_A));
1127
+ /* @return [Integer] keycode for "KP_B" key */
1128
+ rb_define_const(mKey, "KP_B", INT2NUM(SDLK_KP_B));
1129
+ /* @return [Integer] keycode for "KP_C" key */
1130
+ rb_define_const(mKey, "KP_C", INT2NUM(SDLK_KP_C));
1131
+ /* @return [Integer] keycode for "KP_D" key */
1132
+ rb_define_const(mKey, "KP_D", INT2NUM(SDLK_KP_D));
1133
+ /* @return [Integer] keycode for "KP_E" key */
1134
+ rb_define_const(mKey, "KP_E", INT2NUM(SDLK_KP_E));
1135
+ /* @return [Integer] keycode for "KP_F" key */
1136
+ rb_define_const(mKey, "KP_F", INT2NUM(SDLK_KP_F));
1137
+ /* @return [Integer] keycode for "KP_XOR" key */
1138
+ rb_define_const(mKey, "KP_XOR", INT2NUM(SDLK_KP_XOR));
1139
+ /* @return [Integer] keycode for "KP_POWER" key */
1140
+ rb_define_const(mKey, "KP_POWER", INT2NUM(SDLK_KP_POWER));
1141
+ /* @return [Integer] keycode for "KP_PERCENT" key */
1142
+ rb_define_const(mKey, "KP_PERCENT", INT2NUM(SDLK_KP_PERCENT));
1143
+ /* @return [Integer] keycode for "KP_LESS" key */
1144
+ rb_define_const(mKey, "KP_LESS", INT2NUM(SDLK_KP_LESS));
1145
+ /* @return [Integer] keycode for "KP_GREATER" key */
1146
+ rb_define_const(mKey, "KP_GREATER", INT2NUM(SDLK_KP_GREATER));
1147
+ /* @return [Integer] keycode for "KP_AMPERSAND" key */
1148
+ rb_define_const(mKey, "KP_AMPERSAND", INT2NUM(SDLK_KP_AMPERSAND));
1149
+ /* @return [Integer] keycode for "KP_DBLAMPERSAND" key */
1150
+ rb_define_const(mKey, "KP_DBLAMPERSAND", INT2NUM(SDLK_KP_DBLAMPERSAND));
1151
+ /* @return [Integer] keycode for "KP_VERTICALBAR" key */
1152
+ rb_define_const(mKey, "KP_VERTICALBAR", INT2NUM(SDLK_KP_VERTICALBAR));
1153
+ /* @return [Integer] keycode for "KP_DBLVERTICALBAR" key */
1154
+ rb_define_const(mKey, "KP_DBLVERTICALBAR", INT2NUM(SDLK_KP_DBLVERTICALBAR));
1155
+ /* @return [Integer] keycode for "KP_COLON" key */
1156
+ rb_define_const(mKey, "KP_COLON", INT2NUM(SDLK_KP_COLON));
1157
+ /* @return [Integer] keycode for "KP_HASH" key */
1158
+ rb_define_const(mKey, "KP_HASH", INT2NUM(SDLK_KP_HASH));
1159
+ /* @return [Integer] keycode for "KP_SPACE" key */
1160
+ rb_define_const(mKey, "KP_SPACE", INT2NUM(SDLK_KP_SPACE));
1161
+ /* @return [Integer] keycode for "KP_AT" key */
1162
+ rb_define_const(mKey, "KP_AT", INT2NUM(SDLK_KP_AT));
1163
+ /* @return [Integer] keycode for "KP_EXCLAM" key */
1164
+ rb_define_const(mKey, "KP_EXCLAM", INT2NUM(SDLK_KP_EXCLAM));
1165
+ /* @return [Integer] keycode for "KP_MEMSTORE" key */
1166
+ rb_define_const(mKey, "KP_MEMSTORE", INT2NUM(SDLK_KP_MEMSTORE));
1167
+ /* @return [Integer] keycode for "KP_MEMRECALL" key */
1168
+ rb_define_const(mKey, "KP_MEMRECALL", INT2NUM(SDLK_KP_MEMRECALL));
1169
+ /* @return [Integer] keycode for "KP_MEMCLEAR" key */
1170
+ rb_define_const(mKey, "KP_MEMCLEAR", INT2NUM(SDLK_KP_MEMCLEAR));
1171
+ /* @return [Integer] keycode for "KP_MEMADD" key */
1172
+ rb_define_const(mKey, "KP_MEMADD", INT2NUM(SDLK_KP_MEMADD));
1173
+ /* @return [Integer] keycode for "KP_MEMSUBTRACT" key */
1174
+ rb_define_const(mKey, "KP_MEMSUBTRACT", INT2NUM(SDLK_KP_MEMSUBTRACT));
1175
+ /* @return [Integer] keycode for "KP_MEMMULTIPLY" key */
1176
+ rb_define_const(mKey, "KP_MEMMULTIPLY", INT2NUM(SDLK_KP_MEMMULTIPLY));
1177
+ /* @return [Integer] keycode for "KP_MEMDIVIDE" key */
1178
+ rb_define_const(mKey, "KP_MEMDIVIDE", INT2NUM(SDLK_KP_MEMDIVIDE));
1179
+ /* @return [Integer] keycode for "KP_PLUSMINUS" key */
1180
+ rb_define_const(mKey, "KP_PLUSMINUS", INT2NUM(SDLK_KP_PLUSMINUS));
1181
+ /* @return [Integer] keycode for "KP_CLEAR" key */
1182
+ rb_define_const(mKey, "KP_CLEAR", INT2NUM(SDLK_KP_CLEAR));
1183
+ /* @return [Integer] keycode for "KP_CLEARENTRY" key */
1184
+ rb_define_const(mKey, "KP_CLEARENTRY", INT2NUM(SDLK_KP_CLEARENTRY));
1185
+ /* @return [Integer] keycode for "KP_BINARY" key */
1186
+ rb_define_const(mKey, "KP_BINARY", INT2NUM(SDLK_KP_BINARY));
1187
+ /* @return [Integer] keycode for "KP_OCTAL" key */
1188
+ rb_define_const(mKey, "KP_OCTAL", INT2NUM(SDLK_KP_OCTAL));
1189
+ /* @return [Integer] keycode for "KP_DECIMAL" key */
1190
+ rb_define_const(mKey, "KP_DECIMAL", INT2NUM(SDLK_KP_DECIMAL));
1191
+ /* @return [Integer] keycode for "KP_HEXADECIMAL" key */
1192
+ rb_define_const(mKey, "KP_HEXADECIMAL", INT2NUM(SDLK_KP_HEXADECIMAL));
1193
+
1194
+ /* @return [Integer] keycode for "LCTRL" key */
1195
+ rb_define_const(mKey, "LCTRL", INT2NUM(SDLK_LCTRL));
1196
+ /* @return [Integer] keycode for "LSHIFT" key */
1197
+ rb_define_const(mKey, "LSHIFT", INT2NUM(SDLK_LSHIFT));
1198
+ /* @return [Integer] keycode for "LALT" key */
1199
+ rb_define_const(mKey, "LALT", INT2NUM(SDLK_LALT));
1200
+ /* @return [Integer] keycode for "LGUI" key */
1201
+ rb_define_const(mKey, "LGUI", INT2NUM(SDLK_LGUI));
1202
+ /* @return [Integer] keycode for "RCTRL" key */
1203
+ rb_define_const(mKey, "RCTRL", INT2NUM(SDLK_RCTRL));
1204
+ /* @return [Integer] keycode for "RSHIFT" key */
1205
+ rb_define_const(mKey, "RSHIFT", INT2NUM(SDLK_RSHIFT));
1206
+ /* @return [Integer] keycode for "RALT" key */
1207
+ rb_define_const(mKey, "RALT", INT2NUM(SDLK_RALT));
1208
+ /* @return [Integer] keycode for "RGUI" key */
1209
+ rb_define_const(mKey, "RGUI", INT2NUM(SDLK_RGUI));
1210
+
1211
+ /* @return [Integer] keycode for "MODE" key */
1212
+ rb_define_const(mKey, "MODE", INT2NUM(SDLK_MODE));
1213
+
1214
+ /* @return [Integer] keycode for "AUDIONEXT" key */
1215
+ rb_define_const(mKey, "AUDIONEXT", INT2NUM(SDLK_AUDIONEXT));
1216
+ /* @return [Integer] keycode for "AUDIOPREV" key */
1217
+ rb_define_const(mKey, "AUDIOPREV", INT2NUM(SDLK_AUDIOPREV));
1218
+ /* @return [Integer] keycode for "AUDIOSTOP" key */
1219
+ rb_define_const(mKey, "AUDIOSTOP", INT2NUM(SDLK_AUDIOSTOP));
1220
+ /* @return [Integer] keycode for "AUDIOPLAY" key */
1221
+ rb_define_const(mKey, "AUDIOPLAY", INT2NUM(SDLK_AUDIOPLAY));
1222
+ /* @return [Integer] keycode for "AUDIOMUTE" key */
1223
+ rb_define_const(mKey, "AUDIOMUTE", INT2NUM(SDLK_AUDIOMUTE));
1224
+ /* @return [Integer] keycode for "MEDIASELECT" key */
1225
+ rb_define_const(mKey, "MEDIASELECT", INT2NUM(SDLK_MEDIASELECT));
1226
+ /* @return [Integer] keycode for "WWW" key */
1227
+ rb_define_const(mKey, "WWW", INT2NUM(SDLK_WWW));
1228
+ /* @return [Integer] keycode for "MAIL" key */
1229
+ rb_define_const(mKey, "MAIL", INT2NUM(SDLK_MAIL));
1230
+ /* @return [Integer] keycode for "CALCULATOR" key */
1231
+ rb_define_const(mKey, "CALCULATOR", INT2NUM(SDLK_CALCULATOR));
1232
+ /* @return [Integer] keycode for "COMPUTER" key */
1233
+ rb_define_const(mKey, "COMPUTER", INT2NUM(SDLK_COMPUTER));
1234
+ /* @return [Integer] keycode for "AC_SEARCH" key */
1235
+ rb_define_const(mKey, "AC_SEARCH", INT2NUM(SDLK_AC_SEARCH));
1236
+ /* @return [Integer] keycode for "AC_HOME" key */
1237
+ rb_define_const(mKey, "AC_HOME", INT2NUM(SDLK_AC_HOME));
1238
+ /* @return [Integer] keycode for "AC_BACK" key */
1239
+ rb_define_const(mKey, "AC_BACK", INT2NUM(SDLK_AC_BACK));
1240
+ /* @return [Integer] keycode for "AC_FORWARD" key */
1241
+ rb_define_const(mKey, "AC_FORWARD", INT2NUM(SDLK_AC_FORWARD));
1242
+ /* @return [Integer] keycode for "AC_STOP" key */
1243
+ rb_define_const(mKey, "AC_STOP", INT2NUM(SDLK_AC_STOP));
1244
+ /* @return [Integer] keycode for "AC_REFRESH" key */
1245
+ rb_define_const(mKey, "AC_REFRESH", INT2NUM(SDLK_AC_REFRESH));
1246
+ /* @return [Integer] keycode for "AC_BOOKMARKS" key */
1247
+ rb_define_const(mKey, "AC_BOOKMARKS", INT2NUM(SDLK_AC_BOOKMARKS));
1248
+
1249
+ /* @return [Integer] keycode for "BRIGHTNESSDOWN" key */
1250
+ rb_define_const(mKey, "BRIGHTNESSDOWN", INT2NUM(SDLK_BRIGHTNESSDOWN));
1251
+
1252
+ /* @return [Integer] keycode for "BRIGHTNESSUP" key */
1253
+ rb_define_const(mKey, "BRIGHTNESSUP", INT2NUM(SDLK_BRIGHTNESSUP));
1254
+ /* @return [Integer] keycode for "DISPLAYSWITCH" key */
1255
+ rb_define_const(mKey, "DISPLAYSWITCH", INT2NUM(SDLK_DISPLAYSWITCH));
1256
+ /* @return [Integer] keycode for "KBDILLUMTOGGLE" key */
1257
+ rb_define_const(mKey, "KBDILLUMTOGGLE", INT2NUM(SDLK_KBDILLUMTOGGLE));
1258
+
1259
+ /* @return [Integer] keycode for "KBDILLUMDOWN" key */
1260
+ rb_define_const(mKey, "KBDILLUMDOWN", INT2NUM(SDLK_KBDILLUMDOWN));
1261
+ /* @return [Integer] keycode for "KBDILLUMUP" key */
1262
+ rb_define_const(mKey, "KBDILLUMUP", INT2NUM(SDLK_KBDILLUMUP));
1263
+ /* @return [Integer] keycode for "EJECT" key */
1264
+ rb_define_const(mKey, "EJECT", INT2NUM(SDLK_EJECT));
1265
+ /* @return [Integer] keycode for "SLEEP" key */
1266
+ rb_define_const(mKey, "SLEEP", INT2NUM(SDLK_SLEEP));
1267
+
1268
+ /* 0 (no modifier is applicable) */
1269
+ rb_define_const(mMod, "NONE", INT2NUM(KMOD_NONE));
1270
+ /* the modifier key bit mask for the left shift key */
1271
+ rb_define_const(mMod, "LSHIFT", INT2NUM(KMOD_LSHIFT));
1272
+ /* the modifier key bit mask for the right shift key */
1273
+ rb_define_const(mMod, "RSHIFT", INT2NUM(KMOD_RSHIFT));
1274
+ /* the modifier key bit mask for the left control key */
1275
+ rb_define_const(mMod, "LCTRL", INT2NUM(KMOD_LCTRL));
1276
+ /* the modifier key bit mask for the right control key */
1277
+ rb_define_const(mMod, "RCTRL", INT2NUM(KMOD_RCTRL));
1278
+ /* the modifier key bit mask for the left alt key */
1279
+ rb_define_const(mMod, "LALT", INT2NUM(KMOD_LALT));
1280
+ /* the modifier key bit mask for the right alt key */
1281
+ rb_define_const(mMod, "RALT", INT2NUM(KMOD_RALT));
1282
+ /* the modifier key bit mask for the left GUI key (often the window key) */
1283
+ rb_define_const(mMod, "LGUI", INT2NUM(KMOD_LGUI));
1284
+ /* the modifier key bit mask for the right GUI key (often the window key) */
1285
+ rb_define_const(mMod, "RGUI", INT2NUM(KMOD_RGUI));
1286
+ /* the modifier key bit mask for the numlock key */
1287
+ rb_define_const(mMod, "NUM", INT2NUM(KMOD_NUM));
1288
+ /* the modifier key bit mask for the capslock key */
1289
+ rb_define_const(mMod, "CAPS", INT2NUM(KMOD_CAPS));
1290
+ /* the modifier key bit mask for the mode key (AltGr) */
1291
+ rb_define_const(mMod, "MODE", INT2NUM(KMOD_MODE));
1292
+ /* the modifier key bit mask for the left and right control key */
1293
+ rb_define_const(mMod, "CTRL", INT2NUM(KMOD_CTRL));
1294
+ /* the modifier key bit mask for the left and right shift key */
1295
+ rb_define_const(mMod, "SHIFT", INT2NUM(KMOD_SHIFT));
1296
+ /* the modifier key bit mask for the left and right alt key */
1297
+ rb_define_const(mMod, "ALT", INT2NUM(KMOD_ALT));
1298
+ /* the modifier key bit mask for the left and right GUI key */
1299
+ rb_define_const(mMod, "GUI", INT2NUM(KMOD_GUI));
1300
+ /* reserved for future use */
1301
+ rb_define_const(mMod, "RESERVED", INT2NUM(KMOD_RESERVED));
1302
+ }