comparison include/SDL_keysym.h @ 1895:c121d94672cb

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