SDL_keysym.h
上传用户:sun1608
上传日期:2007-02-02
资源大小:6116k
文件大小:7k
源码类别:

流媒体/Mpeg4/MP4

开发平台:

Visual C++

  1. /*
  2.     SDL - Simple DirectMedia Layer
  3.     Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002  Sam Lantinga
  4.     This library is free software; you can redistribute it and/or
  5.     modify it under the terms of the GNU Library General Public
  6.     License as published by the Free Software Foundation; either
  7.     version 2 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.     Library General Public License for more details.
  12.     You should have received a copy of the GNU Library General Public
  13.     License along with this library; if not, write to the Free
  14.     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  15.     Sam Lantinga
  16.     slouken@libsdl.org
  17. */
  18. #ifdef SAVE_RCSID
  19. static char rcsid =
  20.  "@(#) $Id: SDL_keysym.h,v 1.4 2002/04/22 21:38:01 wmay Exp $";
  21. #endif
  22. #ifndef _SDL_keysym_h
  23. #define _SDL_keysym_h
  24. /* What we really want is a mapping of every raw key on the keyboard.
  25.    To support international keyboards, we use the range 0xA1 - 0xFF
  26.    as international virtual keycodes.  We'll follow in the footsteps of X11...
  27.    The names of the keys
  28.  */
  29.  
  30. typedef enum {
  31. /* The keyboard syms have been cleverly chosen to map to ASCII */
  32. SDLK_UNKNOWN = 0,
  33. SDLK_FIRST = 0,
  34. SDLK_BACKSPACE = 8,
  35. SDLK_TAB = 9,
  36. SDLK_CLEAR = 12,
  37. SDLK_RETURN = 13,
  38. SDLK_PAUSE = 19,
  39. SDLK_ESCAPE = 27,
  40. SDLK_SPACE = 32,
  41. SDLK_EXCLAIM = 33,
  42. SDLK_QUOTEDBL = 34,
  43. SDLK_HASH = 35,
  44. SDLK_DOLLAR = 36,
  45. SDLK_AMPERSAND = 38,
  46. SDLK_QUOTE = 39,
  47. SDLK_LEFTPAREN = 40,
  48. SDLK_RIGHTPAREN = 41,
  49. SDLK_ASTERISK = 42,
  50. SDLK_PLUS = 43,
  51. SDLK_COMMA = 44,
  52. SDLK_MINUS = 45,
  53. SDLK_PERIOD = 46,
  54. SDLK_SLASH = 47,
  55. SDLK_0 = 48,
  56. SDLK_1 = 49,
  57. SDLK_2 = 50,
  58. SDLK_3 = 51,
  59. SDLK_4 = 52,
  60. SDLK_5 = 53,
  61. SDLK_6 = 54,
  62. SDLK_7 = 55,
  63. SDLK_8 = 56,
  64. SDLK_9 = 57,
  65. SDLK_COLON = 58,
  66. SDLK_SEMICOLON = 59,
  67. SDLK_LESS = 60,
  68. SDLK_EQUALS = 61,
  69. SDLK_GREATER = 62,
  70. SDLK_QUESTION = 63,
  71. SDLK_AT = 64,
  72. /* 
  73.    Skip uppercase letters
  74.  */
  75. SDLK_LEFTBRACKET = 91,
  76. SDLK_BACKSLASH = 92,
  77. SDLK_RIGHTBRACKET = 93,
  78. SDLK_CARET = 94,
  79. SDLK_UNDERSCORE = 95,
  80. SDLK_BACKQUOTE = 96,
  81. SDLK_a = 97,
  82. SDLK_b = 98,
  83. SDLK_c = 99,
  84. SDLK_d = 100,
  85. SDLK_e = 101,
  86. SDLK_f = 102,
  87. SDLK_g = 103,
  88. SDLK_h = 104,
  89. SDLK_i = 105,
  90. SDLK_j = 106,
  91. SDLK_k = 107,
  92. SDLK_l = 108,
  93. SDLK_m = 109,
  94. SDLK_n = 110,
  95. SDLK_o = 111,
  96. SDLK_p = 112,
  97. SDLK_q = 113,
  98. SDLK_r = 114,
  99. SDLK_s = 115,
  100. SDLK_t = 116,
  101. SDLK_u = 117,
  102. SDLK_v = 118,
  103. SDLK_w = 119,
  104. SDLK_x = 120,
  105. SDLK_y = 121,
  106. SDLK_z = 122,
  107. SDLK_DELETE = 127,
  108. /* End of ASCII mapped keysyms */
  109. /* International keyboard syms */
  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. /* Numeric keypad */
  207. SDLK_KP0 = 256,
  208. SDLK_KP1 = 257,
  209. SDLK_KP2 = 258,
  210. SDLK_KP3 = 259,
  211. SDLK_KP4 = 260,
  212. SDLK_KP5 = 261,
  213. SDLK_KP6 = 262,
  214. SDLK_KP7 = 263,
  215. SDLK_KP8 = 264,
  216. SDLK_KP9 = 265,
  217. SDLK_KP_PERIOD = 266,
  218. SDLK_KP_DIVIDE = 267,
  219. SDLK_KP_MULTIPLY = 268,
  220. SDLK_KP_MINUS = 269,
  221. SDLK_KP_PLUS = 270,
  222. SDLK_KP_ENTER = 271,
  223. SDLK_KP_EQUALS = 272,
  224. /* Arrows + Home/End pad */
  225. SDLK_UP = 273,
  226. SDLK_DOWN = 274,
  227. SDLK_RIGHT = 275,
  228. SDLK_LEFT = 276,
  229. SDLK_INSERT = 277,
  230. SDLK_HOME = 278,
  231. SDLK_END = 279,
  232. SDLK_PAGEUP = 280,
  233. SDLK_PAGEDOWN = 281,
  234. /* Function keys */
  235. SDLK_F1 = 282,
  236. SDLK_F2 = 283,
  237. SDLK_F3 = 284,
  238. SDLK_F4 = 285,
  239. SDLK_F5 = 286,
  240. SDLK_F6 = 287,
  241. SDLK_F7 = 288,
  242. SDLK_F8 = 289,
  243. SDLK_F9 = 290,
  244. SDLK_F10 = 291,
  245. SDLK_F11 = 292,
  246. SDLK_F12 = 293,
  247. SDLK_F13 = 294,
  248. SDLK_F14 = 295,
  249. SDLK_F15 = 296,
  250. /* Key state modifier keys */
  251. SDLK_NUMLOCK = 300,
  252. SDLK_CAPSLOCK = 301,
  253. SDLK_SCROLLOCK = 302,
  254. SDLK_RSHIFT = 303,
  255. SDLK_LSHIFT = 304,
  256. SDLK_RCTRL = 305,
  257. SDLK_LCTRL = 306,
  258. SDLK_RALT = 307,
  259. SDLK_LALT = 308,
  260. SDLK_RMETA = 309,
  261. SDLK_LMETA = 310,
  262. SDLK_LSUPER = 311, /* Left "Windows" key */
  263. SDLK_RSUPER = 312, /* Right "Windows" key */
  264. SDLK_MODE = 313, /* "Alt Gr" key */
  265. SDLK_COMPOSE = 314, /* Multi-key compose key */
  266. /* Miscellaneous function keys */
  267. SDLK_HELP = 315,
  268. SDLK_PRINT = 316,
  269. SDLK_SYSREQ = 317,
  270. SDLK_BREAK = 318,
  271. SDLK_MENU = 319,
  272. SDLK_POWER = 320, /* Power Macintosh power key */
  273. SDLK_EURO = 321, /* Some european keyboards */
  274. SDLK_UNDO = 322, /* Atari keyboard has Undo */
  275. /* Add any other keys here */
  276. SDLK_LAST
  277. } SDLKey;
  278. /* Enumeration of valid key mods (possibly OR'd together) */
  279. typedef enum {
  280. KMOD_NONE  = 0x0000,
  281. KMOD_LSHIFT= 0x0001,
  282. KMOD_RSHIFT= 0x0002,
  283. KMOD_LCTRL = 0x0040,
  284. KMOD_RCTRL = 0x0080,
  285. KMOD_LALT  = 0x0100,
  286. KMOD_RALT  = 0x0200,
  287. KMOD_LMETA = 0x0400,
  288. KMOD_RMETA = 0x0800,
  289. KMOD_NUM   = 0x1000,
  290. KMOD_CAPS  = 0x2000,
  291. KMOD_MODE  = 0x4000,
  292. KMOD_RESERVED = 0x8000
  293. } SDLMod;
  294. #define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL)
  295. #define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT)
  296. #define KMOD_ALT (KMOD_LALT|KMOD_RALT)
  297. #define KMOD_META (KMOD_LMETA|KMOD_RMETA)
  298. #endif /* _SDL_keysym_h */