SDL_keysym.h
上传用户:detong
上传日期:2022-06-22
资源大小:20675k
文件大小:7k
源码类别:

系统编程

开发平台:

Unix_Linux

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