🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

438 lines
16 KiB

  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
  4. This software is provided 'as-is', without any express or implied
  5. warranty. In no event will the authors be held liable for any damages
  6. arising from the use of this software.
  7. Permission is granted to anyone to use this software for any purpose,
  8. including commercial applications, and to alter it and redistribute it
  9. freely, subject to the following restrictions:
  10. 1. The origin of this software must not be misrepresented; you must not
  11. claim that you wrote the original software. If you use this software
  12. in a product, an acknowledgment in the product documentation would be
  13. appreciated but is not required.
  14. 2. Altered source versions must be plainly marked as such, and must not be
  15. misrepresented as being the original software.
  16. 3. This notice may not be removed or altered from any source distribution.
  17. */
  18. /**
  19. * \file SDL_scancode.h
  20. *
  21. * Defines keyboard scancodes.
  22. */
  23. #ifndef SDL_scancode_h_
  24. #define SDL_scancode_h_
  25. #include "SDL_stdinc.h"
  26. /**
  27. * \brief The SDL keyboard scancode representation.
  28. *
  29. * Values of this type are used to represent keyboard keys, among other places
  30. * in the \link SDL_Keysym::scancode key.keysym.scancode \endlink field of the
  31. * SDL_Event structure.
  32. *
  33. * The values in this enumeration are based on the USB usage page standard:
  34. * https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf
  35. */
  36. typedef enum
  37. {
  38. SDL_SCANCODE_UNKNOWN = 0,
  39. /**
  40. * \name Usage page 0x07
  41. *
  42. * These values are from usage page 0x07 (USB keyboard page).
  43. */
  44. /* @{ */
  45. SDL_SCANCODE_A = 4,
  46. SDL_SCANCODE_B = 5,
  47. SDL_SCANCODE_C = 6,
  48. SDL_SCANCODE_D = 7,
  49. SDL_SCANCODE_E = 8,
  50. SDL_SCANCODE_F = 9,
  51. SDL_SCANCODE_G = 10,
  52. SDL_SCANCODE_H = 11,
  53. SDL_SCANCODE_I = 12,
  54. SDL_SCANCODE_J = 13,
  55. SDL_SCANCODE_K = 14,
  56. SDL_SCANCODE_L = 15,
  57. SDL_SCANCODE_M = 16,
  58. SDL_SCANCODE_N = 17,
  59. SDL_SCANCODE_O = 18,
  60. SDL_SCANCODE_P = 19,
  61. SDL_SCANCODE_Q = 20,
  62. SDL_SCANCODE_R = 21,
  63. SDL_SCANCODE_S = 22,
  64. SDL_SCANCODE_T = 23,
  65. SDL_SCANCODE_U = 24,
  66. SDL_SCANCODE_V = 25,
  67. SDL_SCANCODE_W = 26,
  68. SDL_SCANCODE_X = 27,
  69. SDL_SCANCODE_Y = 28,
  70. SDL_SCANCODE_Z = 29,
  71. SDL_SCANCODE_1 = 30,
  72. SDL_SCANCODE_2 = 31,
  73. SDL_SCANCODE_3 = 32,
  74. SDL_SCANCODE_4 = 33,
  75. SDL_SCANCODE_5 = 34,
  76. SDL_SCANCODE_6 = 35,
  77. SDL_SCANCODE_7 = 36,
  78. SDL_SCANCODE_8 = 37,
  79. SDL_SCANCODE_9 = 38,
  80. SDL_SCANCODE_0 = 39,
  81. SDL_SCANCODE_RETURN = 40,
  82. SDL_SCANCODE_ESCAPE = 41,
  83. SDL_SCANCODE_BACKSPACE = 42,
  84. SDL_SCANCODE_TAB = 43,
  85. SDL_SCANCODE_SPACE = 44,
  86. SDL_SCANCODE_MINUS = 45,
  87. SDL_SCANCODE_EQUALS = 46,
  88. SDL_SCANCODE_LEFTBRACKET = 47,
  89. SDL_SCANCODE_RIGHTBRACKET = 48,
  90. SDL_SCANCODE_BACKSLASH = 49, /**< Located at the lower left of the return
  91. * key on ISO keyboards and at the right end
  92. * of the QWERTY row on ANSI keyboards.
  93. * Produces REVERSE SOLIDUS (backslash) and
  94. * VERTICAL LINE in a US layout, REVERSE
  95. * SOLIDUS and VERTICAL LINE in a UK Mac
  96. * layout, NUMBER SIGN and TILDE in a UK
  97. * Windows layout, DOLLAR SIGN and POUND SIGN
  98. * in a Swiss German layout, NUMBER SIGN and
  99. * APOSTROPHE in a German layout, GRAVE
  100. * ACCENT and POUND SIGN in a French Mac
  101. * layout, and ASTERISK and MICRO SIGN in a
  102. * French Windows layout.
  103. */
  104. SDL_SCANCODE_NONUSHASH = 50, /**< ISO USB keyboards actually use this code
  105. * instead of 49 for the same key, but all
  106. * OSes I've seen treat the two codes
  107. * identically. So, as an implementor, unless
  108. * your keyboard generates both of those
  109. * codes and your OS treats them differently,
  110. * you should generate SDL_SCANCODE_BACKSLASH
  111. * instead of this code. As a user, you
  112. * should not rely on this code because SDL
  113. * will never generate it with most (all?)
  114. * keyboards.
  115. */
  116. SDL_SCANCODE_SEMICOLON = 51,
  117. SDL_SCANCODE_APOSTROPHE = 52,
  118. SDL_SCANCODE_GRAVE = 53, /**< Located in the top left corner (on both ANSI
  119. * and ISO keyboards). Produces GRAVE ACCENT and
  120. * TILDE in a US Windows layout and in US and UK
  121. * Mac layouts on ANSI keyboards, GRAVE ACCENT
  122. * and NOT SIGN in a UK Windows layout, SECTION
  123. * SIGN and PLUS-MINUS SIGN in US and UK Mac
  124. * layouts on ISO keyboards, SECTION SIGN and
  125. * DEGREE SIGN in a Swiss German layout (Mac:
  126. * only on ISO keyboards), CIRCUMFLEX ACCENT and
  127. * DEGREE SIGN in a German layout (Mac: only on
  128. * ISO keyboards), SUPERSCRIPT TWO and TILDE in a
  129. * French Windows layout, COMMERCIAL AT and
  130. * NUMBER SIGN in a French Mac layout on ISO
  131. * keyboards, and LESS-THAN SIGN and GREATER-THAN
  132. * SIGN in a Swiss German, German, or French Mac
  133. * layout on ANSI keyboards.
  134. */
  135. SDL_SCANCODE_COMMA = 54,
  136. SDL_SCANCODE_PERIOD = 55,
  137. SDL_SCANCODE_SLASH = 56,
  138. SDL_SCANCODE_CAPSLOCK = 57,
  139. SDL_SCANCODE_F1 = 58,
  140. SDL_SCANCODE_F2 = 59,
  141. SDL_SCANCODE_F3 = 60,
  142. SDL_SCANCODE_F4 = 61,
  143. SDL_SCANCODE_F5 = 62,
  144. SDL_SCANCODE_F6 = 63,
  145. SDL_SCANCODE_F7 = 64,
  146. SDL_SCANCODE_F8 = 65,
  147. SDL_SCANCODE_F9 = 66,
  148. SDL_SCANCODE_F10 = 67,
  149. SDL_SCANCODE_F11 = 68,
  150. SDL_SCANCODE_F12 = 69,
  151. SDL_SCANCODE_PRINTSCREEN = 70,
  152. SDL_SCANCODE_SCROLLLOCK = 71,
  153. SDL_SCANCODE_PAUSE = 72,
  154. SDL_SCANCODE_INSERT = 73, /**< insert on PC, help on some Mac keyboards (but
  155. does send code 73, not 117) */
  156. SDL_SCANCODE_HOME = 74,
  157. SDL_SCANCODE_PAGEUP = 75,
  158. SDL_SCANCODE_DELETE = 76,
  159. SDL_SCANCODE_END = 77,
  160. SDL_SCANCODE_PAGEDOWN = 78,
  161. SDL_SCANCODE_RIGHT = 79,
  162. SDL_SCANCODE_LEFT = 80,
  163. SDL_SCANCODE_DOWN = 81,
  164. SDL_SCANCODE_UP = 82,
  165. SDL_SCANCODE_NUMLOCKCLEAR = 83, /**< num lock on PC, clear on Mac keyboards
  166. */
  167. SDL_SCANCODE_KP_DIVIDE = 84,
  168. SDL_SCANCODE_KP_MULTIPLY = 85,
  169. SDL_SCANCODE_KP_MINUS = 86,
  170. SDL_SCANCODE_KP_PLUS = 87,
  171. SDL_SCANCODE_KP_ENTER = 88,
  172. SDL_SCANCODE_KP_1 = 89,
  173. SDL_SCANCODE_KP_2 = 90,
  174. SDL_SCANCODE_KP_3 = 91,
  175. SDL_SCANCODE_KP_4 = 92,
  176. SDL_SCANCODE_KP_5 = 93,
  177. SDL_SCANCODE_KP_6 = 94,
  178. SDL_SCANCODE_KP_7 = 95,
  179. SDL_SCANCODE_KP_8 = 96,
  180. SDL_SCANCODE_KP_9 = 97,
  181. SDL_SCANCODE_KP_0 = 98,
  182. SDL_SCANCODE_KP_PERIOD = 99,
  183. SDL_SCANCODE_NONUSBACKSLASH = 100, /**< This is the additional key that ISO
  184. * keyboards have over ANSI ones,
  185. * located between left shift and Y.
  186. * Produces GRAVE ACCENT and TILDE in a
  187. * US or UK Mac layout, REVERSE SOLIDUS
  188. * (backslash) and VERTICAL LINE in a
  189. * US or UK Windows layout, and
  190. * LESS-THAN SIGN and GREATER-THAN SIGN
  191. * in a Swiss German, German, or French
  192. * layout. */
  193. SDL_SCANCODE_APPLICATION = 101, /**< windows contextual menu, compose */
  194. SDL_SCANCODE_POWER = 102, /**< The USB document says this is a status flag,
  195. * not a physical key - but some Mac keyboards
  196. * do have a power key. */
  197. SDL_SCANCODE_KP_EQUALS = 103,
  198. SDL_SCANCODE_F13 = 104,
  199. SDL_SCANCODE_F14 = 105,
  200. SDL_SCANCODE_F15 = 106,
  201. SDL_SCANCODE_F16 = 107,
  202. SDL_SCANCODE_F17 = 108,
  203. SDL_SCANCODE_F18 = 109,
  204. SDL_SCANCODE_F19 = 110,
  205. SDL_SCANCODE_F20 = 111,
  206. SDL_SCANCODE_F21 = 112,
  207. SDL_SCANCODE_F22 = 113,
  208. SDL_SCANCODE_F23 = 114,
  209. SDL_SCANCODE_F24 = 115,
  210. SDL_SCANCODE_EXECUTE = 116,
  211. SDL_SCANCODE_HELP = 117, /**< AL Integrated Help Center */
  212. SDL_SCANCODE_MENU = 118, /**< Menu (show menu) */
  213. SDL_SCANCODE_SELECT = 119,
  214. SDL_SCANCODE_STOP = 120, /**< AC Stop */
  215. SDL_SCANCODE_AGAIN = 121, /**< AC Redo/Repeat */
  216. SDL_SCANCODE_UNDO = 122, /**< AC Undo */
  217. SDL_SCANCODE_CUT = 123, /**< AC Cut */
  218. SDL_SCANCODE_COPY = 124, /**< AC Copy */
  219. SDL_SCANCODE_PASTE = 125, /**< AC Paste */
  220. SDL_SCANCODE_FIND = 126, /**< AC Find */
  221. SDL_SCANCODE_MUTE = 127,
  222. SDL_SCANCODE_VOLUMEUP = 128,
  223. SDL_SCANCODE_VOLUMEDOWN = 129,
  224. /* not sure whether there's a reason to enable these */
  225. /* SDL_SCANCODE_LOCKINGCAPSLOCK = 130, */
  226. /* SDL_SCANCODE_LOCKINGNUMLOCK = 131, */
  227. /* SDL_SCANCODE_LOCKINGSCROLLLOCK = 132, */
  228. SDL_SCANCODE_KP_COMMA = 133,
  229. SDL_SCANCODE_KP_EQUALSAS400 = 134,
  230. SDL_SCANCODE_INTERNATIONAL1 = 135, /**< used on Asian keyboards, see
  231. footnotes in USB doc */
  232. SDL_SCANCODE_INTERNATIONAL2 = 136,
  233. SDL_SCANCODE_INTERNATIONAL3 = 137, /**< Yen */
  234. SDL_SCANCODE_INTERNATIONAL4 = 138,
  235. SDL_SCANCODE_INTERNATIONAL5 = 139,
  236. SDL_SCANCODE_INTERNATIONAL6 = 140,
  237. SDL_SCANCODE_INTERNATIONAL7 = 141,
  238. SDL_SCANCODE_INTERNATIONAL8 = 142,
  239. SDL_SCANCODE_INTERNATIONAL9 = 143,
  240. SDL_SCANCODE_LANG1 = 144, /**< Hangul/English toggle */
  241. SDL_SCANCODE_LANG2 = 145, /**< Hanja conversion */
  242. SDL_SCANCODE_LANG3 = 146, /**< Katakana */
  243. SDL_SCANCODE_LANG4 = 147, /**< Hiragana */
  244. SDL_SCANCODE_LANG5 = 148, /**< Zenkaku/Hankaku */
  245. SDL_SCANCODE_LANG6 = 149, /**< reserved */
  246. SDL_SCANCODE_LANG7 = 150, /**< reserved */
  247. SDL_SCANCODE_LANG8 = 151, /**< reserved */
  248. SDL_SCANCODE_LANG9 = 152, /**< reserved */
  249. SDL_SCANCODE_ALTERASE = 153, /**< Erase-Eaze */
  250. SDL_SCANCODE_SYSREQ = 154,
  251. SDL_SCANCODE_CANCEL = 155, /**< AC Cancel */
  252. SDL_SCANCODE_CLEAR = 156,
  253. SDL_SCANCODE_PRIOR = 157,
  254. SDL_SCANCODE_RETURN2 = 158,
  255. SDL_SCANCODE_SEPARATOR = 159,
  256. SDL_SCANCODE_OUT = 160,
  257. SDL_SCANCODE_OPER = 161,
  258. SDL_SCANCODE_CLEARAGAIN = 162,
  259. SDL_SCANCODE_CRSEL = 163,
  260. SDL_SCANCODE_EXSEL = 164,
  261. SDL_SCANCODE_KP_00 = 176,
  262. SDL_SCANCODE_KP_000 = 177,
  263. SDL_SCANCODE_THOUSANDSSEPARATOR = 178,
  264. SDL_SCANCODE_DECIMALSEPARATOR = 179,
  265. SDL_SCANCODE_CURRENCYUNIT = 180,
  266. SDL_SCANCODE_CURRENCYSUBUNIT = 181,
  267. SDL_SCANCODE_KP_LEFTPAREN = 182,
  268. SDL_SCANCODE_KP_RIGHTPAREN = 183,
  269. SDL_SCANCODE_KP_LEFTBRACE = 184,
  270. SDL_SCANCODE_KP_RIGHTBRACE = 185,
  271. SDL_SCANCODE_KP_TAB = 186,
  272. SDL_SCANCODE_KP_BACKSPACE = 187,
  273. SDL_SCANCODE_KP_A = 188,
  274. SDL_SCANCODE_KP_B = 189,
  275. SDL_SCANCODE_KP_C = 190,
  276. SDL_SCANCODE_KP_D = 191,
  277. SDL_SCANCODE_KP_E = 192,
  278. SDL_SCANCODE_KP_F = 193,
  279. SDL_SCANCODE_KP_XOR = 194,
  280. SDL_SCANCODE_KP_POWER = 195,
  281. SDL_SCANCODE_KP_PERCENT = 196,
  282. SDL_SCANCODE_KP_LESS = 197,
  283. SDL_SCANCODE_KP_GREATER = 198,
  284. SDL_SCANCODE_KP_AMPERSAND = 199,
  285. SDL_SCANCODE_KP_DBLAMPERSAND = 200,
  286. SDL_SCANCODE_KP_VERTICALBAR = 201,
  287. SDL_SCANCODE_KP_DBLVERTICALBAR = 202,
  288. SDL_SCANCODE_KP_COLON = 203,
  289. SDL_SCANCODE_KP_HASH = 204,
  290. SDL_SCANCODE_KP_SPACE = 205,
  291. SDL_SCANCODE_KP_AT = 206,
  292. SDL_SCANCODE_KP_EXCLAM = 207,
  293. SDL_SCANCODE_KP_MEMSTORE = 208,
  294. SDL_SCANCODE_KP_MEMRECALL = 209,
  295. SDL_SCANCODE_KP_MEMCLEAR = 210,
  296. SDL_SCANCODE_KP_MEMADD = 211,
  297. SDL_SCANCODE_KP_MEMSUBTRACT = 212,
  298. SDL_SCANCODE_KP_MEMMULTIPLY = 213,
  299. SDL_SCANCODE_KP_MEMDIVIDE = 214,
  300. SDL_SCANCODE_KP_PLUSMINUS = 215,
  301. SDL_SCANCODE_KP_CLEAR = 216,
  302. SDL_SCANCODE_KP_CLEARENTRY = 217,
  303. SDL_SCANCODE_KP_BINARY = 218,
  304. SDL_SCANCODE_KP_OCTAL = 219,
  305. SDL_SCANCODE_KP_DECIMAL = 220,
  306. SDL_SCANCODE_KP_HEXADECIMAL = 221,
  307. SDL_SCANCODE_LCTRL = 224,
  308. SDL_SCANCODE_LSHIFT = 225,
  309. SDL_SCANCODE_LALT = 226, /**< alt, option */
  310. SDL_SCANCODE_LGUI = 227, /**< windows, command (apple), meta */
  311. SDL_SCANCODE_RCTRL = 228,
  312. SDL_SCANCODE_RSHIFT = 229,
  313. SDL_SCANCODE_RALT = 230, /**< alt gr, option */
  314. SDL_SCANCODE_RGUI = 231, /**< windows, command (apple), meta */
  315. SDL_SCANCODE_MODE = 257, /**< I'm not sure if this is really not covered
  316. * by any of the above, but since there's a
  317. * special KMOD_MODE for it I'm adding it here
  318. */
  319. /* @} *//* Usage page 0x07 */
  320. /**
  321. * \name Usage page 0x0C
  322. *
  323. * These values are mapped from usage page 0x0C (USB consumer page).
  324. * See https://usb.org/sites/default/files/hut1_2.pdf
  325. *
  326. * There are way more keys in the spec than we can represent in the
  327. * current scancode range, so pick the ones that commonly come up in
  328. * real world usage.
  329. */
  330. /* @{ */
  331. SDL_SCANCODE_AUDIONEXT = 258,
  332. SDL_SCANCODE_AUDIOPREV = 259,
  333. SDL_SCANCODE_AUDIOSTOP = 260,
  334. SDL_SCANCODE_AUDIOPLAY = 261,
  335. SDL_SCANCODE_AUDIOMUTE = 262,
  336. SDL_SCANCODE_MEDIASELECT = 263,
  337. SDL_SCANCODE_WWW = 264, /**< AL Internet Browser */
  338. SDL_SCANCODE_MAIL = 265,
  339. SDL_SCANCODE_CALCULATOR = 266, /**< AL Calculator */
  340. SDL_SCANCODE_COMPUTER = 267,
  341. SDL_SCANCODE_AC_SEARCH = 268, /**< AC Search */
  342. SDL_SCANCODE_AC_HOME = 269, /**< AC Home */
  343. SDL_SCANCODE_AC_BACK = 270, /**< AC Back */
  344. SDL_SCANCODE_AC_FORWARD = 271, /**< AC Forward */
  345. SDL_SCANCODE_AC_STOP = 272, /**< AC Stop */
  346. SDL_SCANCODE_AC_REFRESH = 273, /**< AC Refresh */
  347. SDL_SCANCODE_AC_BOOKMARKS = 274, /**< AC Bookmarks */
  348. /* @} *//* Usage page 0x0C */
  349. /**
  350. * \name Walther keys
  351. *
  352. * These are values that Christian Walther added (for mac keyboard?).
  353. */
  354. /* @{ */
  355. SDL_SCANCODE_BRIGHTNESSDOWN = 275,
  356. SDL_SCANCODE_BRIGHTNESSUP = 276,
  357. SDL_SCANCODE_DISPLAYSWITCH = 277, /**< display mirroring/dual display
  358. switch, video mode switch */
  359. SDL_SCANCODE_KBDILLUMTOGGLE = 278,
  360. SDL_SCANCODE_KBDILLUMDOWN = 279,
  361. SDL_SCANCODE_KBDILLUMUP = 280,
  362. SDL_SCANCODE_EJECT = 281,
  363. SDL_SCANCODE_SLEEP = 282, /**< SC System Sleep */
  364. SDL_SCANCODE_APP1 = 283,
  365. SDL_SCANCODE_APP2 = 284,
  366. /* @} *//* Walther keys */
  367. /**
  368. * \name Usage page 0x0C (additional media keys)
  369. *
  370. * These values are mapped from usage page 0x0C (USB consumer page).
  371. */
  372. /* @{ */
  373. SDL_SCANCODE_AUDIOREWIND = 285,
  374. SDL_SCANCODE_AUDIOFASTFORWARD = 286,
  375. /* @} *//* Usage page 0x0C (additional media keys) */
  376. /**
  377. * \name Mobile keys
  378. *
  379. * These are values that are often used on mobile phones.
  380. */
  381. /* @{ */
  382. SDL_SCANCODE_SOFTLEFT = 287, /**< Usually situated below the display on phones and
  383. used as a multi-function feature key for selecting
  384. a software defined function shown on the bottom left
  385. of the display. */
  386. SDL_SCANCODE_SOFTRIGHT = 288, /**< Usually situated below the display on phones and
  387. used as a multi-function feature key for selecting
  388. a software defined function shown on the bottom right
  389. of the display. */
  390. SDL_SCANCODE_CALL = 289, /**< Used for accepting phone calls. */
  391. SDL_SCANCODE_ENDCALL = 290, /**< Used for rejecting phone calls. */
  392. /* @} *//* Mobile keys */
  393. /* Add any other keys here. */
  394. SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes
  395. for array bounds */
  396. } SDL_Scancode;
  397. #endif /* SDL_scancode_h_ */
  398. /* vi: set ts=4 sw=4 expandtab: */