1 //
2 // Copyright (c) 2008-2017 the Urho3D project.
3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal
6 // in the Software without restriction, including without limitation the rights
7 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 // copies of the Software, and to permit persons to whom the Software is
9 // furnished to do so, subject to the following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included in
12 // all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 // THE SOFTWARE.
21 //
22 
23 #pragma once
24 
25 #include "../Core/Object.h"
26 
27 #include <SDL/SDL_joystick.h>
28 #include <SDL/SDL_gamecontroller.h>
29 #include <SDL/SDL_keycode.h>
30 #include <SDL/SDL_mouse.h>
31 
32 namespace Urho3D
33 {
34 
35 /// Mouse button pressed.
URHO3D_EVENT(E_MOUSEBUTTONDOWN,MouseButtonDown)36 URHO3D_EVENT(E_MOUSEBUTTONDOWN, MouseButtonDown)
37 {
38     URHO3D_PARAM(P_BUTTON, Button);                // int
39     URHO3D_PARAM(P_BUTTONS, Buttons);              // int
40     URHO3D_PARAM(P_QUALIFIERS, Qualifiers);        // int
41 }
42 
43 /// Mouse button released.
URHO3D_EVENT(E_MOUSEBUTTONUP,MouseButtonUp)44 URHO3D_EVENT(E_MOUSEBUTTONUP, MouseButtonUp)
45 {
46     URHO3D_PARAM(P_BUTTON, Button);                // int
47     URHO3D_PARAM(P_BUTTONS, Buttons);              // int
48     URHO3D_PARAM(P_QUALIFIERS, Qualifiers);        // int
49 }
50 
51 /// Mouse moved.
URHO3D_EVENT(E_MOUSEMOVE,MouseMove)52 URHO3D_EVENT(E_MOUSEMOVE, MouseMove)
53 {
54     URHO3D_PARAM(P_X, X);                          // int (only when mouse visible)
55     URHO3D_PARAM(P_Y, Y);                          // int (only when mouse visible)
56     URHO3D_PARAM(P_DX, DX);                        // int
57     URHO3D_PARAM(P_DY, DY);                        // int
58     URHO3D_PARAM(P_BUTTONS, Buttons);              // int
59     URHO3D_PARAM(P_QUALIFIERS, Qualifiers);        // int
60 }
61 
62 /// Mouse wheel moved.
URHO3D_EVENT(E_MOUSEWHEEL,MouseWheel)63 URHO3D_EVENT(E_MOUSEWHEEL, MouseWheel)
64 {
65     URHO3D_PARAM(P_WHEEL, Wheel);                  // int
66     URHO3D_PARAM(P_BUTTONS, Buttons);              // int
67     URHO3D_PARAM(P_QUALIFIERS, Qualifiers);        // int
68 }
69 
70 /// Key pressed.
URHO3D_EVENT(E_KEYDOWN,KeyDown)71 URHO3D_EVENT(E_KEYDOWN, KeyDown)
72 {
73     URHO3D_PARAM(P_KEY, Key);                      // int
74     URHO3D_PARAM(P_SCANCODE, Scancode);            // int
75     URHO3D_PARAM(P_BUTTONS, Buttons);              // int
76     URHO3D_PARAM(P_QUALIFIERS, Qualifiers);        // int
77     URHO3D_PARAM(P_REPEAT, Repeat);                // bool
78 }
79 
80 /// Key released.
URHO3D_EVENT(E_KEYUP,KeyUp)81 URHO3D_EVENT(E_KEYUP, KeyUp)
82 {
83     URHO3D_PARAM(P_KEY, Key);                      // int
84     URHO3D_PARAM(P_SCANCODE, Scancode);            // int
85     URHO3D_PARAM(P_BUTTONS, Buttons);              // int
86     URHO3D_PARAM(P_QUALIFIERS, Qualifiers);        // int
87 }
88 
89 /// Text input event.
URHO3D_EVENT(E_TEXTINPUT,TextInput)90 URHO3D_EVENT(E_TEXTINPUT, TextInput)
91 {
92     URHO3D_PARAM(P_TEXT, Text);                    // String
93 }
94 
95 /// Text editing event.
URHO3D_EVENT(E_TEXTEDITING,TextEditing)96 URHO3D_EVENT(E_TEXTEDITING, TextEditing)
97 {
98     URHO3D_PARAM(P_COMPOSITION, Composition);      // String
99     URHO3D_PARAM(P_CURSOR, Cursor);                // int
100     URHO3D_PARAM(P_SELECTION_LENGTH, SelectionLength);  // int
101 }
102 
103 /// Joystick connected.
URHO3D_EVENT(E_JOYSTICKCONNECTED,JoystickConnected)104 URHO3D_EVENT(E_JOYSTICKCONNECTED, JoystickConnected)
105 {
106     URHO3D_PARAM(P_JOYSTICKID, JoystickID);        // int
107 }
108 
109 /// Joystick disconnected.
URHO3D_EVENT(E_JOYSTICKDISCONNECTED,JoystickDisconnected)110 URHO3D_EVENT(E_JOYSTICKDISCONNECTED, JoystickDisconnected)
111 {
112     URHO3D_PARAM(P_JOYSTICKID, JoystickID);        // int
113 }
114 
115 /// Joystick button pressed.
URHO3D_EVENT(E_JOYSTICKBUTTONDOWN,JoystickButtonDown)116 URHO3D_EVENT(E_JOYSTICKBUTTONDOWN, JoystickButtonDown)
117 {
118     URHO3D_PARAM(P_JOYSTICKID, JoystickID);        // int
119     URHO3D_PARAM(P_BUTTON, Button);                // int
120 }
121 
122 /// Joystick button released.
URHO3D_EVENT(E_JOYSTICKBUTTONUP,JoystickButtonUp)123 URHO3D_EVENT(E_JOYSTICKBUTTONUP, JoystickButtonUp)
124 {
125     URHO3D_PARAM(P_JOYSTICKID, JoystickID);        // int
126     URHO3D_PARAM(P_BUTTON, Button);                // int
127 }
128 
129 /// Joystick axis moved.
URHO3D_EVENT(E_JOYSTICKAXISMOVE,JoystickAxisMove)130 URHO3D_EVENT(E_JOYSTICKAXISMOVE, JoystickAxisMove)
131 {
132     URHO3D_PARAM(P_JOYSTICKID, JoystickID);        // int
133     URHO3D_PARAM(P_AXIS, Button);                  // int
134     URHO3D_PARAM(P_POSITION, Position);            // float
135 }
136 
137 /// Joystick POV hat moved.
URHO3D_EVENT(E_JOYSTICKHATMOVE,JoystickHatMove)138 URHO3D_EVENT(E_JOYSTICKHATMOVE, JoystickHatMove)
139 {
140     URHO3D_PARAM(P_JOYSTICKID, JoystickID);        // int
141     URHO3D_PARAM(P_HAT, Button);                   // int
142     URHO3D_PARAM(P_POSITION, Position);            // int
143 }
144 
145 /// Finger pressed on the screen.
URHO3D_EVENT(E_TOUCHBEGIN,TouchBegin)146 URHO3D_EVENT(E_TOUCHBEGIN, TouchBegin)
147 {
148     URHO3D_PARAM(P_TOUCHID, TouchID);              // int
149     URHO3D_PARAM(P_X, X);                          // int
150     URHO3D_PARAM(P_Y, Y);                          // int
151     URHO3D_PARAM(P_PRESSURE, Pressure);            // float
152 }
153 
154 /// Finger released from the screen.
URHO3D_EVENT(E_TOUCHEND,TouchEnd)155 URHO3D_EVENT(E_TOUCHEND, TouchEnd)
156 {
157     URHO3D_PARAM(P_TOUCHID, TouchID);              // int
158     URHO3D_PARAM(P_X, X);                          // int
159     URHO3D_PARAM(P_Y, Y);                          // int
160 }
161 
162 /// Finger moved on the screen.
URHO3D_EVENT(E_TOUCHMOVE,TouchMove)163 URHO3D_EVENT(E_TOUCHMOVE, TouchMove)
164 {
165     URHO3D_PARAM(P_TOUCHID, TouchID);              // int
166     URHO3D_PARAM(P_X, X);                          // int
167     URHO3D_PARAM(P_Y, Y);                          // int
168     URHO3D_PARAM(P_DX, DX);                        // int
169     URHO3D_PARAM(P_DY, DY);                        // int
170     URHO3D_PARAM(P_PRESSURE, Pressure);            // float
171 }
172 
173 /// A touch gesture finished recording.
URHO3D_EVENT(E_GESTURERECORDED,GestureRecorded)174 URHO3D_EVENT(E_GESTURERECORDED, GestureRecorded)
175 {
176     URHO3D_PARAM(P_GESTUREID, GestureID);          // unsigned
177 }
178 
179 /// A recognized touch gesture was input by the user.
URHO3D_EVENT(E_GESTUREINPUT,GestureInput)180 URHO3D_EVENT(E_GESTUREINPUT, GestureInput)
181 {
182     URHO3D_PARAM(P_GESTUREID, GestureID);          // unsigned
183     URHO3D_PARAM(P_CENTERX, CenterX);              // int
184     URHO3D_PARAM(P_CENTERY, CenterY);              // int
185     URHO3D_PARAM(P_NUMFINGERS, NumFingers);        // int
186     URHO3D_PARAM(P_ERROR, Error);                  // float
187 }
188 
189 /// Pinch/rotate multi-finger touch gesture motion update.
URHO3D_EVENT(E_MULTIGESTURE,MultiGesture)190 URHO3D_EVENT(E_MULTIGESTURE, MultiGesture)
191 {
192     URHO3D_PARAM(P_CENTERX, CenterX);              // int
193     URHO3D_PARAM(P_CENTERY, CenterY);              // int
194     URHO3D_PARAM(P_NUMFINGERS, NumFingers);        // int
195     URHO3D_PARAM(P_DTHETA, DTheta);                // float (degrees)
196     URHO3D_PARAM(P_DDIST, DDist);                  // float
197 }
198 
199 /// A file was drag-dropped into the application window.
URHO3D_EVENT(E_DROPFILE,DropFile)200 URHO3D_EVENT(E_DROPFILE, DropFile)
201 {
202     URHO3D_PARAM(P_FILENAME, FileName);            // String
203 }
204 
205 /// Application input focus or minimization changed.
URHO3D_EVENT(E_INPUTFOCUS,InputFocus)206 URHO3D_EVENT(E_INPUTFOCUS, InputFocus)
207 {
208     URHO3D_PARAM(P_FOCUS, Focus);                  // bool
209     URHO3D_PARAM(P_MINIMIZED, Minimized);          // bool
210 }
211 
212 /// OS mouse cursor visibility changed.
URHO3D_EVENT(E_MOUSEVISIBLECHANGED,MouseVisibleChanged)213 URHO3D_EVENT(E_MOUSEVISIBLECHANGED, MouseVisibleChanged)
214 {
215     URHO3D_PARAM(P_VISIBLE, Visible);              // bool
216 }
217 
218 /// Mouse mode changed.
URHO3D_EVENT(E_MOUSEMODECHANGED,MouseModeChanged)219 URHO3D_EVENT(E_MOUSEMODECHANGED, MouseModeChanged)
220 {
221     URHO3D_PARAM(P_MODE, Mode);                    // MouseMode
222     URHO3D_PARAM(P_MOUSELOCKED, MouseLocked);      // bool
223 }
224 
225 /// Application exit requested.
URHO3D_EVENT(E_EXITREQUESTED,ExitRequested)226 URHO3D_EVENT(E_EXITREQUESTED, ExitRequested)
227 {
228 }
229 
230 /// Raw SDL input event.
URHO3D_EVENT(E_SDLRAWINPUT,SDLRawInput)231 URHO3D_EVENT(E_SDLRAWINPUT, SDLRawInput)
232 {
233     URHO3D_PARAM(P_SDLEVENT, SDLEvent);           // SDL_Event*
234     URHO3D_PARAM(P_CONSUMED, Consumed);            // bool
235 }
236 
237 /// Input handling begins.
URHO3D_EVENT(E_INPUTBEGIN,InputBegin)238 URHO3D_EVENT(E_INPUTBEGIN, InputBegin)
239 {
240 }
241 
242 /// Input handling ends.
URHO3D_EVENT(E_INPUTEND,InputEnd)243 URHO3D_EVENT(E_INPUTEND, InputEnd)
244 {
245 }
246 
247 static const int MOUSEB_LEFT = SDL_BUTTON_LMASK;
248 static const int MOUSEB_MIDDLE = SDL_BUTTON_MMASK;
249 static const int MOUSEB_RIGHT = SDL_BUTTON_RMASK;
250 static const int MOUSEB_X1 = SDL_BUTTON_X1MASK;
251 static const int MOUSEB_X2 = SDL_BUTTON_X2MASK;
252 
253 static const int QUAL_SHIFT = 1;
254 static const int QUAL_CTRL = 2;
255 static const int QUAL_ALT = 4;
256 static const int QUAL_ANY = 8;
257 
258 static const int KEY_UNKNOWN = SDLK_UNKNOWN;
259 static const int KEY_A = SDLK_a;
260 static const int KEY_B = SDLK_b;
261 static const int KEY_C = SDLK_c;
262 static const int KEY_D = SDLK_d;
263 static const int KEY_E = SDLK_e;
264 static const int KEY_F = SDLK_f;
265 static const int KEY_G = SDLK_g;
266 static const int KEY_H = SDLK_h;
267 static const int KEY_I = SDLK_i;
268 static const int KEY_J = SDLK_j;
269 static const int KEY_K = SDLK_k;
270 static const int KEY_L = SDLK_l;
271 static const int KEY_M = SDLK_m;
272 static const int KEY_N = SDLK_n;
273 static const int KEY_O = SDLK_o;
274 static const int KEY_P = SDLK_p;
275 static const int KEY_Q = SDLK_q;
276 static const int KEY_R = SDLK_r;
277 static const int KEY_S = SDLK_s;
278 static const int KEY_T = SDLK_t;
279 static const int KEY_U = SDLK_u;
280 static const int KEY_V = SDLK_v;
281 static const int KEY_W = SDLK_w;
282 static const int KEY_X = SDLK_x;
283 static const int KEY_Y = SDLK_y;
284 static const int KEY_Z = SDLK_z;
285 static const int KEY_0 = SDLK_0;
286 static const int KEY_1 = SDLK_1;
287 static const int KEY_2 = SDLK_2;
288 static const int KEY_3 = SDLK_3;
289 static const int KEY_4 = SDLK_4;
290 static const int KEY_5 = SDLK_5;
291 static const int KEY_6 = SDLK_6;
292 static const int KEY_7 = SDLK_7;
293 static const int KEY_8 = SDLK_8;
294 static const int KEY_9 = SDLK_9;
295 static const int KEY_BACKSPACE = SDLK_BACKSPACE;
296 static const int KEY_TAB = SDLK_TAB;
297 static const int KEY_RETURN = SDLK_RETURN;
298 static const int KEY_RETURN2 = SDLK_RETURN2;
299 static const int KEY_KP_ENTER = SDLK_KP_ENTER;
300 static const int KEY_SHIFT = SDLK_LSHIFT;
301 static const int KEY_CTRL = SDLK_LCTRL;
302 static const int KEY_ALT = SDLK_LALT;
303 static const int KEY_GUI = SDLK_LGUI;
304 static const int KEY_PAUSE = SDLK_PAUSE;
305 static const int KEY_CAPSLOCK = SDLK_CAPSLOCK;
306 static const int KEY_ESCAPE = SDLK_ESCAPE;
307 static const int KEY_SPACE = SDLK_SPACE;
308 static const int KEY_PAGEUP = SDLK_PAGEUP;
309 static const int KEY_PAGEDOWN = SDLK_PAGEDOWN;
310 static const int KEY_END = SDLK_END;
311 static const int KEY_HOME = SDLK_HOME;
312 static const int KEY_LEFT = SDLK_LEFT;
313 static const int KEY_UP = SDLK_UP;
314 static const int KEY_RIGHT = SDLK_RIGHT;
315 static const int KEY_DOWN = SDLK_DOWN;
316 static const int KEY_SELECT = SDLK_SELECT;
317 static const int KEY_PRINTSCREEN = SDLK_PRINTSCREEN;
318 static const int KEY_INSERT = SDLK_INSERT;
319 static const int KEY_DELETE = SDLK_DELETE;
320 static const int KEY_LGUI = SDLK_LGUI;
321 static const int KEY_RGUI = SDLK_RGUI;
322 static const int KEY_APPLICATION = SDLK_APPLICATION;
323 static const int KEY_KP_0 = SDLK_KP_0;
324 static const int KEY_KP_1 = SDLK_KP_1;
325 static const int KEY_KP_2 = SDLK_KP_2;
326 static const int KEY_KP_3 = SDLK_KP_3;
327 static const int KEY_KP_4 = SDLK_KP_4;
328 static const int KEY_KP_5 = SDLK_KP_5;
329 static const int KEY_KP_6 = SDLK_KP_6;
330 static const int KEY_KP_7 = SDLK_KP_7;
331 static const int KEY_KP_8 = SDLK_KP_8;
332 static const int KEY_KP_9 = SDLK_KP_9;
333 static const int KEY_KP_MULTIPLY = SDLK_KP_MULTIPLY;
334 static const int KEY_KP_PLUS = SDLK_KP_PLUS;
335 static const int KEY_KP_MINUS = SDLK_KP_MINUS;
336 static const int KEY_KP_PERIOD = SDLK_KP_PERIOD;
337 static const int KEY_KP_DIVIDE = SDLK_KP_DIVIDE;
338 static const int KEY_F1 = SDLK_F1;
339 static const int KEY_F2 = SDLK_F2;
340 static const int KEY_F3 = SDLK_F3;
341 static const int KEY_F4 = SDLK_F4;
342 static const int KEY_F5 = SDLK_F5;
343 static const int KEY_F6 = SDLK_F6;
344 static const int KEY_F7 = SDLK_F7;
345 static const int KEY_F8 = SDLK_F8;
346 static const int KEY_F9 = SDLK_F9;
347 static const int KEY_F10 = SDLK_F10;
348 static const int KEY_F11 = SDLK_F11;
349 static const int KEY_F12 = SDLK_F12;
350 static const int KEY_F13 = SDLK_F13;
351 static const int KEY_F14 = SDLK_F14;
352 static const int KEY_F15 = SDLK_F15;
353 static const int KEY_F16 = SDLK_F16;
354 static const int KEY_F17 = SDLK_F17;
355 static const int KEY_F18 = SDLK_F18;
356 static const int KEY_F19 = SDLK_F19;
357 static const int KEY_F20 = SDLK_F20;
358 static const int KEY_F21 = SDLK_F21;
359 static const int KEY_F22 = SDLK_F22;
360 static const int KEY_F23 = SDLK_F23;
361 static const int KEY_F24 = SDLK_F24;
362 static const int KEY_NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR;
363 static const int KEY_SCROLLLOCK = SDLK_SCROLLLOCK;
364 static const int KEY_LSHIFT = SDLK_LSHIFT;
365 static const int KEY_RSHIFT = SDLK_RSHIFT;
366 static const int KEY_LCTRL = SDLK_LCTRL;
367 static const int KEY_RCTRL = SDLK_RCTRL;
368 static const int KEY_LALT = SDLK_LALT;
369 static const int KEY_RALT = SDLK_RALT;
370 
371 static const int SCANCODE_UNKNOWN = SDL_SCANCODE_UNKNOWN;
372 static const int SCANCODE_CTRL = SDL_SCANCODE_LCTRL;
373 static const int SCANCODE_SHIFT = SDL_SCANCODE_LSHIFT;
374 static const int SCANCODE_ALT = SDL_SCANCODE_LALT;
375 static const int SCANCODE_GUI = SDL_SCANCODE_LGUI;
376 static const int SCANCODE_A = SDL_SCANCODE_A;
377 static const int SCANCODE_B = SDL_SCANCODE_B;
378 static const int SCANCODE_C = SDL_SCANCODE_C;
379 static const int SCANCODE_D = SDL_SCANCODE_D;
380 static const int SCANCODE_E = SDL_SCANCODE_E;
381 static const int SCANCODE_F = SDL_SCANCODE_F;
382 static const int SCANCODE_G = SDL_SCANCODE_G;
383 static const int SCANCODE_H = SDL_SCANCODE_H;
384 static const int SCANCODE_I = SDL_SCANCODE_I;
385 static const int SCANCODE_J = SDL_SCANCODE_J;
386 static const int SCANCODE_K = SDL_SCANCODE_K;
387 static const int SCANCODE_L = SDL_SCANCODE_L;
388 static const int SCANCODE_M = SDL_SCANCODE_M;
389 static const int SCANCODE_N = SDL_SCANCODE_N;
390 static const int SCANCODE_O = SDL_SCANCODE_O;
391 static const int SCANCODE_P = SDL_SCANCODE_P;
392 static const int SCANCODE_Q = SDL_SCANCODE_Q;
393 static const int SCANCODE_R = SDL_SCANCODE_R;
394 static const int SCANCODE_S = SDL_SCANCODE_S;
395 static const int SCANCODE_T = SDL_SCANCODE_T;
396 static const int SCANCODE_U = SDL_SCANCODE_U;
397 static const int SCANCODE_V = SDL_SCANCODE_V;
398 static const int SCANCODE_W = SDL_SCANCODE_W;
399 static const int SCANCODE_X = SDL_SCANCODE_X;
400 static const int SCANCODE_Y = SDL_SCANCODE_Y;
401 static const int SCANCODE_Z = SDL_SCANCODE_Z;
402 static const int SCANCODE_1 = SDL_SCANCODE_1;
403 static const int SCANCODE_2 = SDL_SCANCODE_2;
404 static const int SCANCODE_3 = SDL_SCANCODE_3;
405 static const int SCANCODE_4 = SDL_SCANCODE_4;
406 static const int SCANCODE_5 = SDL_SCANCODE_5;
407 static const int SCANCODE_6 = SDL_SCANCODE_6;
408 static const int SCANCODE_7 = SDL_SCANCODE_7;
409 static const int SCANCODE_8 = SDL_SCANCODE_8;
410 static const int SCANCODE_9 = SDL_SCANCODE_9;
411 static const int SCANCODE_0 = SDL_SCANCODE_0;
412 static const int SCANCODE_RETURN = SDL_SCANCODE_RETURN;
413 static const int SCANCODE_ESCAPE = SDL_SCANCODE_ESCAPE;
414 static const int SCANCODE_BACKSPACE = SDL_SCANCODE_BACKSPACE;
415 static const int SCANCODE_TAB = SDL_SCANCODE_TAB;
416 static const int SCANCODE_SPACE = SDL_SCANCODE_SPACE;
417 static const int SCANCODE_MINUS = SDL_SCANCODE_MINUS;
418 static const int SCANCODE_EQUALS = SDL_SCANCODE_EQUALS;
419 static const int SCANCODE_LEFTBRACKET = SDL_SCANCODE_LEFTBRACKET;
420 static const int SCANCODE_RIGHTBRACKET = SDL_SCANCODE_RIGHTBRACKET;
421 static const int SCANCODE_BACKSLASH = SDL_SCANCODE_BACKSLASH;
422 static const int SCANCODE_NONUSHASH = SDL_SCANCODE_NONUSHASH;
423 static const int SCANCODE_SEMICOLON = SDL_SCANCODE_SEMICOLON;
424 static const int SCANCODE_APOSTROPHE = SDL_SCANCODE_APOSTROPHE;
425 static const int SCANCODE_GRAVE = SDL_SCANCODE_GRAVE;
426 static const int SCANCODE_COMMA = SDL_SCANCODE_COMMA;
427 static const int SCANCODE_PERIOD = SDL_SCANCODE_PERIOD;
428 static const int SCANCODE_SLASH = SDL_SCANCODE_SLASH;
429 static const int SCANCODE_CAPSLOCK = SDL_SCANCODE_CAPSLOCK;
430 static const int SCANCODE_F1 = SDL_SCANCODE_F1;
431 static const int SCANCODE_F2 = SDL_SCANCODE_F2;
432 static const int SCANCODE_F3 = SDL_SCANCODE_F3;
433 static const int SCANCODE_F4 = SDL_SCANCODE_F4;
434 static const int SCANCODE_F5 = SDL_SCANCODE_F5;
435 static const int SCANCODE_F6 = SDL_SCANCODE_F6;
436 static const int SCANCODE_F7 = SDL_SCANCODE_F7;
437 static const int SCANCODE_F8 = SDL_SCANCODE_F8;
438 static const int SCANCODE_F9 = SDL_SCANCODE_F9;
439 static const int SCANCODE_F10 = SDL_SCANCODE_F10;
440 static const int SCANCODE_F11 = SDL_SCANCODE_F11;
441 static const int SCANCODE_F12 = SDL_SCANCODE_F12;
442 static const int SCANCODE_PRINTSCREEN = SDL_SCANCODE_PRINTSCREEN;
443 static const int SCANCODE_SCROLLLOCK = SDL_SCANCODE_SCROLLLOCK;
444 static const int SCANCODE_PAUSE = SDL_SCANCODE_PAUSE;
445 static const int SCANCODE_INSERT = SDL_SCANCODE_INSERT;
446 static const int SCANCODE_HOME = SDL_SCANCODE_HOME;
447 static const int SCANCODE_PAGEUP = SDL_SCANCODE_PAGEUP;
448 static const int SCANCODE_DELETE = SDL_SCANCODE_DELETE;
449 static const int SCANCODE_END = SDL_SCANCODE_END;
450 static const int SCANCODE_PAGEDOWN = SDL_SCANCODE_PAGEDOWN;
451 static const int SCANCODE_RIGHT = SDL_SCANCODE_RIGHT;
452 static const int SCANCODE_LEFT = SDL_SCANCODE_LEFT;
453 static const int SCANCODE_DOWN = SDL_SCANCODE_DOWN;
454 static const int SCANCODE_UP = SDL_SCANCODE_UP;
455 static const int SCANCODE_NUMLOCKCLEAR = SDL_SCANCODE_NUMLOCKCLEAR;
456 static const int SCANCODE_KP_DIVIDE = SDL_SCANCODE_KP_DIVIDE;
457 static const int SCANCODE_KP_MULTIPLY = SDL_SCANCODE_KP_MULTIPLY;
458 static const int SCANCODE_KP_MINUS = SDL_SCANCODE_KP_MINUS;
459 static const int SCANCODE_KP_PLUS = SDL_SCANCODE_KP_PLUS;
460 static const int SCANCODE_KP_ENTER = SDL_SCANCODE_KP_ENTER;
461 static const int SCANCODE_KP_1 = SDL_SCANCODE_KP_1;
462 static const int SCANCODE_KP_2 = SDL_SCANCODE_KP_2;
463 static const int SCANCODE_KP_3 = SDL_SCANCODE_KP_3;
464 static const int SCANCODE_KP_4 = SDL_SCANCODE_KP_4;
465 static const int SCANCODE_KP_5 = SDL_SCANCODE_KP_5;
466 static const int SCANCODE_KP_6 = SDL_SCANCODE_KP_6;
467 static const int SCANCODE_KP_7 = SDL_SCANCODE_KP_7;
468 static const int SCANCODE_KP_8 = SDL_SCANCODE_KP_8;
469 static const int SCANCODE_KP_9 = SDL_SCANCODE_KP_9;
470 static const int SCANCODE_KP_0 = SDL_SCANCODE_KP_0;
471 static const int SCANCODE_KP_PERIOD = SDL_SCANCODE_KP_PERIOD;
472 static const int SCANCODE_NONUSBACKSLASH = SDL_SCANCODE_NONUSBACKSLASH;
473 static const int SCANCODE_APPLICATION = SDL_SCANCODE_APPLICATION;
474 static const int SCANCODE_POWER = SDL_SCANCODE_POWER;
475 static const int SCANCODE_KP_EQUALS = SDL_SCANCODE_KP_EQUALS;
476 static const int SCANCODE_F13 = SDL_SCANCODE_F13;
477 static const int SCANCODE_F14 = SDL_SCANCODE_F14;
478 static const int SCANCODE_F15 = SDL_SCANCODE_F15;
479 static const int SCANCODE_F16 = SDL_SCANCODE_F16;
480 static const int SCANCODE_F17 = SDL_SCANCODE_F17;
481 static const int SCANCODE_F18 = SDL_SCANCODE_F18;
482 static const int SCANCODE_F19 = SDL_SCANCODE_F19;
483 static const int SCANCODE_F20 = SDL_SCANCODE_F20;
484 static const int SCANCODE_F21 = SDL_SCANCODE_F21;
485 static const int SCANCODE_F22 = SDL_SCANCODE_F22;
486 static const int SCANCODE_F23 = SDL_SCANCODE_F23;
487 static const int SCANCODE_F24 = SDL_SCANCODE_F24;
488 static const int SCANCODE_EXECUTE = SDL_SCANCODE_EXECUTE;
489 static const int SCANCODE_HELP = SDL_SCANCODE_HELP;
490 static const int SCANCODE_MENU = SDL_SCANCODE_MENU;
491 static const int SCANCODE_SELECT = SDL_SCANCODE_SELECT;
492 static const int SCANCODE_STOP = SDL_SCANCODE_STOP;
493 static const int SCANCODE_AGAIN = SDL_SCANCODE_AGAIN;
494 static const int SCANCODE_UNDO = SDL_SCANCODE_UNDO;
495 static const int SCANCODE_CUT = SDL_SCANCODE_CUT;
496 static const int SCANCODE_COPY = SDL_SCANCODE_COPY;
497 static const int SCANCODE_PASTE = SDL_SCANCODE_PASTE;
498 static const int SCANCODE_FIND = SDL_SCANCODE_FIND;
499 static const int SCANCODE_MUTE = SDL_SCANCODE_MUTE;
500 static const int SCANCODE_VOLUMEUP = SDL_SCANCODE_VOLUMEUP;
501 static const int SCANCODE_VOLUMEDOWN = SDL_SCANCODE_VOLUMEDOWN;
502 static const int SCANCODE_KP_COMMA = SDL_SCANCODE_KP_COMMA;
503 static const int SCANCODE_KP_EQUALSAS400 = SDL_SCANCODE_KP_EQUALSAS400;
504 static const int SCANCODE_INTERNATIONAL1 = SDL_SCANCODE_INTERNATIONAL1;
505 static const int SCANCODE_INTERNATIONAL2 = SDL_SCANCODE_INTERNATIONAL2;
506 static const int SCANCODE_INTERNATIONAL3 = SDL_SCANCODE_INTERNATIONAL3;
507 static const int SCANCODE_INTERNATIONAL4 = SDL_SCANCODE_INTERNATIONAL4;
508 static const int SCANCODE_INTERNATIONAL5 = SDL_SCANCODE_INTERNATIONAL5;
509 static const int SCANCODE_INTERNATIONAL6 = SDL_SCANCODE_INTERNATIONAL6;
510 static const int SCANCODE_INTERNATIONAL7 = SDL_SCANCODE_INTERNATIONAL7;
511 static const int SCANCODE_INTERNATIONAL8 = SDL_SCANCODE_INTERNATIONAL8;
512 static const int SCANCODE_INTERNATIONAL9 = SDL_SCANCODE_INTERNATIONAL9;
513 static const int SCANCODE_LANG1 = SDL_SCANCODE_LANG1;
514 static const int SCANCODE_LANG2 = SDL_SCANCODE_LANG2;
515 static const int SCANCODE_LANG3 = SDL_SCANCODE_LANG3;
516 static const int SCANCODE_LANG4 = SDL_SCANCODE_LANG4;
517 static const int SCANCODE_LANG5 = SDL_SCANCODE_LANG5;
518 static const int SCANCODE_LANG6 = SDL_SCANCODE_LANG6;
519 static const int SCANCODE_LANG7 = SDL_SCANCODE_LANG7;
520 static const int SCANCODE_LANG8 = SDL_SCANCODE_LANG8;
521 static const int SCANCODE_LANG9 = SDL_SCANCODE_LANG9;
522 static const int SCANCODE_ALTERASE = SDL_SCANCODE_ALTERASE;
523 static const int SCANCODE_SYSREQ = SDL_SCANCODE_SYSREQ;
524 static const int SCANCODE_CANCEL = SDL_SCANCODE_CANCEL;
525 static const int SCANCODE_CLEAR = SDL_SCANCODE_CLEAR;
526 static const int SCANCODE_PRIOR = SDL_SCANCODE_PRIOR;
527 static const int SCANCODE_RETURN2 = SDL_SCANCODE_RETURN2;
528 static const int SCANCODE_SEPARATOR = SDL_SCANCODE_SEPARATOR;
529 static const int SCANCODE_OUT = SDL_SCANCODE_OUT;
530 static const int SCANCODE_OPER = SDL_SCANCODE_OPER;
531 static const int SCANCODE_CLEARAGAIN = SDL_SCANCODE_CLEARAGAIN;
532 static const int SCANCODE_CRSEL = SDL_SCANCODE_CRSEL;
533 static const int SCANCODE_EXSEL = SDL_SCANCODE_EXSEL;
534 static const int SCANCODE_KP_00 = SDL_SCANCODE_KP_00;
535 static const int SCANCODE_KP_000 = SDL_SCANCODE_KP_000;
536 static const int SCANCODE_THOUSANDSSEPARATOR = SDL_SCANCODE_THOUSANDSSEPARATOR;
537 static const int SCANCODE_DECIMALSEPARATOR = SDL_SCANCODE_DECIMALSEPARATOR;
538 static const int SCANCODE_CURRENCYUNIT = SDL_SCANCODE_CURRENCYUNIT;
539 static const int SCANCODE_CURRENCYSUBUNIT = SDL_SCANCODE_CURRENCYSUBUNIT;
540 static const int SCANCODE_KP_LEFTPAREN = SDL_SCANCODE_KP_LEFTPAREN;
541 static const int SCANCODE_KP_RIGHTPAREN = SDL_SCANCODE_KP_RIGHTPAREN;
542 static const int SCANCODE_KP_LEFTBRACE = SDL_SCANCODE_KP_LEFTBRACE;
543 static const int SCANCODE_KP_RIGHTBRACE = SDL_SCANCODE_KP_RIGHTBRACE;
544 static const int SCANCODE_KP_TAB = SDL_SCANCODE_KP_TAB;
545 static const int SCANCODE_KP_BACKSPACE = SDL_SCANCODE_KP_BACKSPACE;
546 static const int SCANCODE_KP_A = SDL_SCANCODE_KP_A;
547 static const int SCANCODE_KP_B = SDL_SCANCODE_KP_B;
548 static const int SCANCODE_KP_C = SDL_SCANCODE_KP_C;
549 static const int SCANCODE_KP_D = SDL_SCANCODE_KP_D;
550 static const int SCANCODE_KP_E = SDL_SCANCODE_KP_E;
551 static const int SCANCODE_KP_F = SDL_SCANCODE_KP_F;
552 static const int SCANCODE_KP_XOR = SDL_SCANCODE_KP_XOR;
553 static const int SCANCODE_KP_POWER = SDL_SCANCODE_KP_POWER;
554 static const int SCANCODE_KP_PERCENT = SDL_SCANCODE_KP_PERCENT;
555 static const int SCANCODE_KP_LESS = SDL_SCANCODE_KP_LESS;
556 static const int SCANCODE_KP_GREATER = SDL_SCANCODE_KP_GREATER;
557 static const int SCANCODE_KP_AMPERSAND = SDL_SCANCODE_KP_AMPERSAND;
558 static const int SCANCODE_KP_DBLAMPERSAND = SDL_SCANCODE_KP_DBLAMPERSAND;
559 static const int SCANCODE_KP_VERTICALBAR = SDL_SCANCODE_KP_VERTICALBAR;
560 static const int SCANCODE_KP_DBLVERTICALBAR = SDL_SCANCODE_KP_DBLVERTICALBAR;
561 static const int SCANCODE_KP_COLON = SDL_SCANCODE_KP_COLON;
562 static const int SCANCODE_KP_HASH = SDL_SCANCODE_KP_HASH;
563 static const int SCANCODE_KP_SPACE = SDL_SCANCODE_KP_SPACE;
564 static const int SCANCODE_KP_AT = SDL_SCANCODE_KP_AT;
565 static const int SCANCODE_KP_EXCLAM = SDL_SCANCODE_KP_EXCLAM;
566 static const int SCANCODE_KP_MEMSTORE = SDL_SCANCODE_KP_MEMSTORE;
567 static const int SCANCODE_KP_MEMRECALL = SDL_SCANCODE_KP_MEMRECALL;
568 static const int SCANCODE_KP_MEMCLEAR = SDL_SCANCODE_KP_MEMCLEAR;
569 static const int SCANCODE_KP_MEMADD = SDL_SCANCODE_KP_MEMADD;
570 static const int SCANCODE_KP_MEMSUBTRACT = SDL_SCANCODE_KP_MEMSUBTRACT;
571 static const int SCANCODE_KP_MEMMULTIPLY = SDL_SCANCODE_KP_MEMMULTIPLY;
572 static const int SCANCODE_KP_MEMDIVIDE = SDL_SCANCODE_KP_MEMDIVIDE;
573 static const int SCANCODE_KP_PLUSMINUS = SDL_SCANCODE_KP_PLUSMINUS;
574 static const int SCANCODE_KP_CLEAR = SDL_SCANCODE_KP_CLEAR;
575 static const int SCANCODE_KP_CLEARENTRY = SDL_SCANCODE_KP_CLEARENTRY;
576 static const int SCANCODE_KP_BINARY = SDL_SCANCODE_KP_BINARY;
577 static const int SCANCODE_KP_OCTAL = SDL_SCANCODE_KP_OCTAL;
578 static const int SCANCODE_KP_DECIMAL = SDL_SCANCODE_KP_DECIMAL;
579 static const int SCANCODE_KP_HEXADECIMAL = SDL_SCANCODE_KP_HEXADECIMAL;
580 static const int SCANCODE_LCTRL = SDL_SCANCODE_LCTRL;
581 static const int SCANCODE_LSHIFT = SDL_SCANCODE_LSHIFT;
582 static const int SCANCODE_LALT = SDL_SCANCODE_LALT;
583 static const int SCANCODE_LGUI = SDL_SCANCODE_LGUI;
584 static const int SCANCODE_RCTRL = SDL_SCANCODE_RCTRL;
585 static const int SCANCODE_RSHIFT = SDL_SCANCODE_RSHIFT;
586 static const int SCANCODE_RALT = SDL_SCANCODE_RALT;
587 static const int SCANCODE_RGUI = SDL_SCANCODE_RGUI;
588 static const int SCANCODE_MODE = SDL_SCANCODE_MODE;
589 static const int SCANCODE_AUDIONEXT = SDL_SCANCODE_AUDIONEXT;
590 static const int SCANCODE_AUDIOPREV = SDL_SCANCODE_AUDIOPREV;
591 static const int SCANCODE_AUDIOSTOP = SDL_SCANCODE_AUDIOSTOP;
592 static const int SCANCODE_AUDIOPLAY = SDL_SCANCODE_AUDIOPLAY;
593 static const int SCANCODE_AUDIOMUTE = SDL_SCANCODE_AUDIOMUTE;
594 static const int SCANCODE_MEDIASELECT = SDL_SCANCODE_MEDIASELECT;
595 static const int SCANCODE_WWW = SDL_SCANCODE_WWW;
596 static const int SCANCODE_MAIL = SDL_SCANCODE_MAIL;
597 static const int SCANCODE_CALCULATOR = SDL_SCANCODE_CALCULATOR;
598 static const int SCANCODE_COMPUTER = SDL_SCANCODE_COMPUTER;
599 static const int SCANCODE_AC_SEARCH = SDL_SCANCODE_AC_SEARCH;
600 static const int SCANCODE_AC_HOME = SDL_SCANCODE_AC_HOME;
601 static const int SCANCODE_AC_BACK = SDL_SCANCODE_AC_BACK;
602 static const int SCANCODE_AC_FORWARD = SDL_SCANCODE_AC_FORWARD;
603 static const int SCANCODE_AC_STOP = SDL_SCANCODE_AC_STOP;
604 static const int SCANCODE_AC_REFRESH = SDL_SCANCODE_AC_REFRESH;
605 static const int SCANCODE_AC_BOOKMARKS = SDL_SCANCODE_AC_BOOKMARKS;
606 static const int SCANCODE_BRIGHTNESSDOWN = SDL_SCANCODE_BRIGHTNESSDOWN;
607 static const int SCANCODE_BRIGHTNESSUP = SDL_SCANCODE_BRIGHTNESSUP;
608 static const int SCANCODE_DISPLAYSWITCH = SDL_SCANCODE_DISPLAYSWITCH;
609 static const int SCANCODE_KBDILLUMTOGGLE = SDL_SCANCODE_KBDILLUMTOGGLE;
610 static const int SCANCODE_KBDILLUMDOWN = SDL_SCANCODE_KBDILLUMDOWN;
611 static const int SCANCODE_KBDILLUMUP = SDL_SCANCODE_KBDILLUMUP;
612 static const int SCANCODE_EJECT = SDL_SCANCODE_EJECT;
613 static const int SCANCODE_SLEEP = SDL_SCANCODE_SLEEP;
614 static const int SCANCODE_APP1 = SDL_SCANCODE_APP1;
615 static const int SCANCODE_APP2 = SDL_SCANCODE_APP2;
616 
617 static const int HAT_CENTER = SDL_HAT_CENTERED;
618 static const int HAT_UP = SDL_HAT_UP;
619 static const int HAT_RIGHT = SDL_HAT_RIGHT;
620 static const int HAT_DOWN = SDL_HAT_DOWN;
621 static const int HAT_LEFT = SDL_HAT_LEFT;
622 
623 static const int CONTROLLER_BUTTON_A = SDL_CONTROLLER_BUTTON_A;
624 static const int CONTROLLER_BUTTON_B = SDL_CONTROLLER_BUTTON_B;
625 static const int CONTROLLER_BUTTON_X = SDL_CONTROLLER_BUTTON_X;
626 static const int CONTROLLER_BUTTON_Y = SDL_CONTROLLER_BUTTON_Y;
627 static const int CONTROLLER_BUTTON_BACK = SDL_CONTROLLER_BUTTON_BACK;
628 static const int CONTROLLER_BUTTON_GUIDE = SDL_CONTROLLER_BUTTON_GUIDE;
629 static const int CONTROLLER_BUTTON_START = SDL_CONTROLLER_BUTTON_START;
630 static const int CONTROLLER_BUTTON_LEFTSTICK = SDL_CONTROLLER_BUTTON_LEFTSTICK;
631 static const int CONTROLLER_BUTTON_RIGHTSTICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK;
632 static const int CONTROLLER_BUTTON_LEFTSHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER;
633 static const int CONTROLLER_BUTTON_RIGHTSHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER;
634 static const int CONTROLLER_BUTTON_DPAD_UP = SDL_CONTROLLER_BUTTON_DPAD_UP;
635 static const int CONTROLLER_BUTTON_DPAD_DOWN = SDL_CONTROLLER_BUTTON_DPAD_DOWN;
636 static const int CONTROLLER_BUTTON_DPAD_LEFT = SDL_CONTROLLER_BUTTON_DPAD_LEFT;
637 static const int CONTROLLER_BUTTON_DPAD_RIGHT = SDL_CONTROLLER_BUTTON_DPAD_RIGHT;
638 
639 static const int CONTROLLER_AXIS_LEFTX = SDL_CONTROLLER_AXIS_LEFTX;
640 static const int CONTROLLER_AXIS_LEFTY = SDL_CONTROLLER_AXIS_LEFTY;
641 static const int CONTROLLER_AXIS_RIGHTX = SDL_CONTROLLER_AXIS_RIGHTX;
642 static const int CONTROLLER_AXIS_RIGHTY = SDL_CONTROLLER_AXIS_RIGHTY;
643 static const int CONTROLLER_AXIS_TRIGGERLEFT = SDL_CONTROLLER_AXIS_TRIGGERLEFT;
644 static const int CONTROLLER_AXIS_TRIGGERRIGHT = SDL_CONTROLLER_AXIS_TRIGGERRIGHT;
645 
646 }
647