SDL_keysym.h 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. /*
  2. SDL - Simple DirectMedia Layer
  3. Copyright (C) 1997-2009 Sam Lantinga
  4. This library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. This library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with this library; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  15. Sam Lantinga
  16. slouken@libsdl.org
  17. */
  18. #ifndef _SDL_keysym_h
  19. #define _SDL_keysym_h
  20. /** What we really want is a mapping of every raw key on the keyboard.
  21. * To support international keyboards, we use the range 0xA1 - 0xFF
  22. * as international virtual keycodes. We'll follow in the footsteps of X11...
  23. * @brief The names of the keys
  24. */
  25. typedef enum {
  26. /** @name ASCII mapped keysyms
  27. * The keyboard syms have been cleverly chosen to map to ASCII
  28. */
  29. /*@{*/
  30. SDLK_UNKNOWN = 0,
  31. SDLK_FIRST = 0,
  32. SDLK_BACKSPACE = 8,
  33. SDLK_TAB = 9,
  34. SDLK_CLEAR = 12,
  35. SDLK_RETURN = 13,
  36. SDLK_PAUSE = 19,
  37. SDLK_ESCAPE = 27,
  38. SDLK_SPACE = 32,
  39. SDLK_EXCLAIM = 33,
  40. SDLK_QUOTEDBL = 34,
  41. SDLK_HASH = 35,
  42. SDLK_DOLLAR = 36,
  43. SDLK_AMPERSAND = 38,
  44. SDLK_QUOTE = 39,
  45. SDLK_LEFTPAREN = 40,
  46. SDLK_RIGHTPAREN = 41,
  47. SDLK_ASTERISK = 42,
  48. SDLK_PLUS = 43,
  49. SDLK_COMMA = 44,
  50. SDLK_MINUS = 45,
  51. SDLK_PERIOD = 46,
  52. SDLK_SLASH = 47,
  53. SDLK_0 = 48,
  54. SDLK_1 = 49,
  55. SDLK_2 = 50,
  56. SDLK_3 = 51,
  57. SDLK_4 = 52,
  58. SDLK_5 = 53,
  59. SDLK_6 = 54,
  60. SDLK_7 = 55,
  61. SDLK_8 = 56,
  62. SDLK_9 = 57,
  63. SDLK_COLON = 58,
  64. SDLK_SEMICOLON = 59,
  65. SDLK_LESS = 60,
  66. SDLK_EQUALS = 61,
  67. SDLK_GREATER = 62,
  68. SDLK_QUESTION = 63,
  69. SDLK_AT = 64,
  70. /*
  71. Skip uppercase letters
  72. */
  73. SDLK_LEFTBRACKET = 91,
  74. SDLK_BACKSLASH = 92,
  75. SDLK_RIGHTBRACKET = 93,
  76. SDLK_CARET = 94,
  77. SDLK_UNDERSCORE = 95,
  78. SDLK_BACKQUOTE = 96,
  79. SDLK_a = 97,
  80. SDLK_b = 98,
  81. SDLK_c = 99,
  82. SDLK_d = 100,
  83. SDLK_e = 101,
  84. SDLK_f = 102,
  85. SDLK_g = 103,
  86. SDLK_h = 104,
  87. SDLK_i = 105,
  88. SDLK_j = 106,
  89. SDLK_k = 107,
  90. SDLK_l = 108,
  91. SDLK_m = 109,
  92. SDLK_n = 110,
  93. SDLK_o = 111,
  94. SDLK_p = 112,
  95. SDLK_q = 113,
  96. SDLK_r = 114,
  97. SDLK_s = 115,
  98. SDLK_t = 116,
  99. SDLK_u = 117,
  100. SDLK_v = 118,
  101. SDLK_w = 119,
  102. SDLK_x = 120,
  103. SDLK_y = 121,
  104. SDLK_z = 122,
  105. SDLK_DELETE = 127,
  106. /* End of ASCII mapped keysyms */
  107. /*@}*/
  108. /** @name International keyboard syms */
  109. /*@{*/
  110. SDLK_WORLD_0 = 160, /* 0xA0 */
  111. SDLK_WORLD_1 = 161,
  112. SDLK_WORLD_2 = 162,
  113. SDLK_WORLD_3 = 163,
  114. SDLK_WORLD_4 = 164,
  115. SDLK_WORLD_5 = 165,
  116. SDLK_WORLD_6 = 166,
  117. SDLK_WORLD_7 = 167,
  118. SDLK_WORLD_8 = 168,
  119. SDLK_WORLD_9 = 169,
  120. SDLK_WORLD_10 = 170,
  121. SDLK_WORLD_11 = 171,
  122. SDLK_WORLD_12 = 172,
  123. SDLK_WORLD_13 = 173,
  124. SDLK_WORLD_14 = 174,
  125. SDLK_WORLD_15 = 175,
  126. SDLK_WORLD_16 = 176,
  127. SDLK_WORLD_17 = 177,
  128. SDLK_WORLD_18 = 178,
  129. SDLK_WORLD_19 = 179,
  130. SDLK_WORLD_20 = 180,
  131. SDLK_WORLD_21 = 181,
  132. SDLK_WORLD_22 = 182,
  133. SDLK_WORLD_23 = 183,
  134. SDLK_WORLD_24 = 184,
  135. SDLK_WORLD_25 = 185,
  136. SDLK_WORLD_26 = 186,
  137. SDLK_WORLD_27 = 187,
  138. SDLK_WORLD_28 = 188,
  139. SDLK_WORLD_29 = 189,
  140. SDLK_WORLD_30 = 190,
  141. SDLK_WORLD_31 = 191,
  142. SDLK_WORLD_32 = 192,
  143. SDLK_WORLD_33 = 193,
  144. SDLK_WORLD_34 = 194,
  145. SDLK_WORLD_35 = 195,
  146. SDLK_WORLD_36 = 196,
  147. SDLK_WORLD_37 = 197,
  148. SDLK_WORLD_38 = 198,
  149. SDLK_WORLD_39 = 199,
  150. SDLK_WORLD_40 = 200,
  151. SDLK_WORLD_41 = 201,
  152. SDLK_WORLD_42 = 202,
  153. SDLK_WORLD_43 = 203,
  154. SDLK_WORLD_44 = 204,
  155. SDLK_WORLD_45 = 205,
  156. SDLK_WORLD_46 = 206,
  157. SDLK_WORLD_47 = 207,
  158. SDLK_WORLD_48 = 208,
  159. SDLK_WORLD_49 = 209,
  160. SDLK_WORLD_50 = 210,
  161. SDLK_WORLD_51 = 211,
  162. SDLK_WORLD_52 = 212,
  163. SDLK_WORLD_53 = 213,
  164. SDLK_WORLD_54 = 214,
  165. SDLK_WORLD_55 = 215,
  166. SDLK_WORLD_56 = 216,
  167. SDLK_WORLD_57 = 217,
  168. SDLK_WORLD_58 = 218,
  169. SDLK_WORLD_59 = 219,
  170. SDLK_WORLD_60 = 220,
  171. SDLK_WORLD_61 = 221,
  172. SDLK_WORLD_62 = 222,
  173. SDLK_WORLD_63 = 223,
  174. SDLK_WORLD_64 = 224,
  175. SDLK_WORLD_65 = 225,
  176. SDLK_WORLD_66 = 226,
  177. SDLK_WORLD_67 = 227,
  178. SDLK_WORLD_68 = 228,
  179. SDLK_WORLD_69 = 229,
  180. SDLK_WORLD_70 = 230,
  181. SDLK_WORLD_71 = 231,
  182. SDLK_WORLD_72 = 232,
  183. SDLK_WORLD_73 = 233,
  184. SDLK_WORLD_74 = 234,
  185. SDLK_WORLD_75 = 235,
  186. SDLK_WORLD_76 = 236,
  187. SDLK_WORLD_77 = 237,
  188. SDLK_WORLD_78 = 238,
  189. SDLK_WORLD_79 = 239,
  190. SDLK_WORLD_80 = 240,
  191. SDLK_WORLD_81 = 241,
  192. SDLK_WORLD_82 = 242,
  193. SDLK_WORLD_83 = 243,
  194. SDLK_WORLD_84 = 244,
  195. SDLK_WORLD_85 = 245,
  196. SDLK_WORLD_86 = 246,
  197. SDLK_WORLD_87 = 247,
  198. SDLK_WORLD_88 = 248,
  199. SDLK_WORLD_89 = 249,
  200. SDLK_WORLD_90 = 250,
  201. SDLK_WORLD_91 = 251,
  202. SDLK_WORLD_92 = 252,
  203. SDLK_WORLD_93 = 253,
  204. SDLK_WORLD_94 = 254,
  205. SDLK_WORLD_95 = 255, /* 0xFF */
  206. /*@}*/
  207. /** @name Numeric keypad */
  208. /*@{*/
  209. SDLK_KP0 = 256,
  210. SDLK_KP1 = 257,
  211. SDLK_KP2 = 258,
  212. SDLK_KP3 = 259,
  213. SDLK_KP4 = 260,
  214. SDLK_KP5 = 261,
  215. SDLK_KP6 = 262,
  216. SDLK_KP7 = 263,
  217. SDLK_KP8 = 264,
  218. SDLK_KP9 = 265,
  219. SDLK_KP_PERIOD = 266,
  220. SDLK_KP_DIVIDE = 267,
  221. SDLK_KP_MULTIPLY = 268,
  222. SDLK_KP_MINUS = 269,
  223. SDLK_KP_PLUS = 270,
  224. SDLK_KP_ENTER = 271,
  225. SDLK_KP_EQUALS = 272,
  226. /*@}*/
  227. /** @name Arrows + Home/End pad */
  228. /*@{*/
  229. SDLK_UP = 273,
  230. SDLK_DOWN = 274,
  231. SDLK_RIGHT = 275,
  232. SDLK_LEFT = 276,
  233. SDLK_INSERT = 277,
  234. SDLK_HOME = 278,
  235. SDLK_END = 279,
  236. SDLK_PAGEUP = 280,
  237. SDLK_PAGEDOWN = 281,
  238. /*@}*/
  239. /** @name Function keys */
  240. /*@{*/
  241. SDLK_F1 = 282,
  242. SDLK_F2 = 283,
  243. SDLK_F3 = 284,
  244. SDLK_F4 = 285,
  245. SDLK_F5 = 286,
  246. SDLK_F6 = 287,
  247. SDLK_F7 = 288,
  248. SDLK_F8 = 289,
  249. SDLK_F9 = 290,
  250. SDLK_F10 = 291,
  251. SDLK_F11 = 292,
  252. SDLK_F12 = 293,
  253. SDLK_F13 = 294,
  254. SDLK_F14 = 295,
  255. SDLK_F15 = 296,
  256. /*@}*/
  257. /** @name Key state modifier keys */
  258. /*@{*/
  259. SDLK_NUMLOCK = 300,
  260. SDLK_CAPSLOCK = 301,
  261. SDLK_SCROLLOCK = 302,
  262. SDLK_RSHIFT = 303,
  263. SDLK_LSHIFT = 304,
  264. SDLK_RCTRL = 305,
  265. SDLK_LCTRL = 306,
  266. SDLK_RALT = 307,
  267. SDLK_LALT = 308,
  268. SDLK_RMETA = 309,
  269. SDLK_LMETA = 310,
  270. SDLK_LSUPER = 311, /**< Left "Windows" key */
  271. SDLK_RSUPER = 312, /**< Right "Windows" key */
  272. SDLK_MODE = 313, /**< "Alt Gr" key */
  273. SDLK_COMPOSE = 314, /**< Multi-key compose key */
  274. /*@}*/
  275. /** @name Miscellaneous function keys */
  276. /*@{*/
  277. SDLK_HELP = 315,
  278. SDLK_PRINT = 316,
  279. SDLK_SYSREQ = 317,
  280. SDLK_BREAK = 318,
  281. SDLK_MENU = 319,
  282. SDLK_POWER = 320, /**< Power Macintosh power key */
  283. SDLK_EURO = 321, /**< Some european keyboards */
  284. SDLK_UNDO = 322, /**< Atari keyboard has Undo */
  285. /*@}*/
  286. /* Add any other keys here */
  287. SDLK_LAST
  288. } SDLKey;
  289. /** Enumeration of valid key mods (possibly OR'd together) */
  290. typedef enum {
  291. KMOD_NONE = 0x0000,
  292. KMOD_LSHIFT= 0x0001,
  293. KMOD_RSHIFT= 0x0002,
  294. KMOD_LCTRL = 0x0040,
  295. KMOD_RCTRL = 0x0080,
  296. KMOD_LALT = 0x0100,
  297. KMOD_RALT = 0x0200,
  298. KMOD_LMETA = 0x0400,
  299. KMOD_RMETA = 0x0800,
  300. KMOD_NUM = 0x1000,
  301. KMOD_CAPS = 0x2000,
  302. KMOD_MODE = 0x4000,
  303. KMOD_RESERVED = 0x8000
  304. } SDLMod;
  305. #define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL)
  306. #define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT)
  307. #define KMOD_ALT (KMOD_LALT|KMOD_RALT)
  308. #define KMOD_META (KMOD_LMETA|KMOD_RMETA)
  309. #endif /* _SDL_keysym_h */