InputEvents.h 28 KB

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