Mercurial > sdl-ios-xcode
comparison include/SDL_keysym.h @ 2303:d87417504c75
First pass implementation of new SDL scancode concept, as discussed with
Christian Walther. Currently only implemented on Mac OS X for sanity
checking purposes.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 05 Feb 2008 07:19:23 +0000 |
parents | dbc6d1893869 |
children | fbe8ff44c519 |
comparison
equal
deleted
inserted
replaced
2302:7ae1c419b626 | 2303:d87417504c75 |
---|---|
26 | 26 |
27 #ifndef _SDL_keysym_h | 27 #ifndef _SDL_keysym_h |
28 #define _SDL_keysym_h | 28 #define _SDL_keysym_h |
29 | 29 |
30 #include "SDL_stdinc.h" | 30 #include "SDL_stdinc.h" |
31 #include "SDL_scancode.h" | |
31 | 32 |
32 /** | 33 /** |
33 * \typedef SDLKey | 34 * \typedef SDLKey |
34 * | 35 * |
35 * \brief The SDL virtual key representation. | 36 * \brief The SDL virtual key representation. |
36 * | 37 * |
37 * Values of this type are used to represent keyboard keys, among other places | 38 * Values of this type are used to represent keyboard keys using the current |
38 * in the \link SDL_keysym::sym key.keysym.sym \endlink field of the SDL_Event | 39 * layout of the keyboard. These values include Unicode values representing |
39 * structure. | 40 * the unmodified character that would be generated by pressing the key, or |
40 * | 41 * an SDLK_* constant for those keys that do not generate characters. |
41 * There are two fundamental ways of referring to a key: First, a certain code | |
42 * can stand for a key at a specific physical location on the keyboard, | |
43 * independent of its label or what character it generates. These are the \e | |
44 * physical key codes, comparable to the raw hardware scancodes that a keyboard | |
45 * generates. Second, a code can refer to a key with a specific label, | |
46 * generating a specific character or performing a specific function, which may | |
47 * be located at different places on the keyboard, or not exist at all, | |
48 * depending on what keyboard layout is used. These are \e layout key codes. | |
49 * | |
50 * There is a certain overlap between the sets of physical key codes and layout | |
51 * key codes: \e return, \e tab, \e ctrl etc. are typically independent of the | |
52 * keyboard layout and can be thought of as either a physical or a layout key. | |
53 * Therefore, rather than having separate types with separate sets of constants | |
54 * for physical keys and layout keys, a single type ::SDLKey is used for both | |
55 * sets. The physical key codes (forming a well-known set of a few hundred | |
56 * elements) are enumerated in enum ::SDLPhysicalKey. The set of layout key | |
57 * codes is more diverse: For keys that don't generate characters, the layout | |
58 * key code is equal to the physical key code, i.e. the same SDLK_* constants | |
59 * from enum ::SDLPhysicalKey are used. For character keys, the layout key code | |
60 * is equal to the Unicode code point of the character that is generated when | |
61 * the key is pressed without shift or any other modifiers (for ASCII | |
62 * characters, this can be directly written as a character literal like | |
63 * <tt>'x'</tt>). | |
64 * | |
65 * The \link SDL_keysym::sym key.keysym.sym \endlink field of the SDL_Event | |
66 * structure is always a physical key code. To get the layout key code for the | |
67 * event, run that physical key code through SDL_GetLayoutKey(), which converts | |
68 * it to a layout key code according to the current keyboard layout settings of | |
69 * the OS. In particular, this is what should be done when displaying the name | |
70 * of a key to the user: use | |
71 * <tt>SDL_GetKeyName(SDL_GetLayoutKey(myPhysicalKeyCode))</tt>. Do not use | |
72 * SDL_GetKeyName() directly on a physical key code (except for debugging | |
73 * purposes), as the name returned by that will not correspond to how the key | |
74 * is labeled on the user's keyboard. | |
75 * | |
76 * \par Example: | |
77 * To implement WASD directional keys, it makes sense to use physical key | |
78 * codes, so that the "forward" key will be above the "backward" key even | |
79 * though, for example, it's labeled "Z", not "W", on a French keyboard: | |
80 * \code | |
81 * print("To go forward, press the %s key.", SDL_GetKeyName(SDL_GetLayoutKey(SDLK_W))); | |
82 * ... | |
83 * switch (event.key.keysym.sym) { | |
84 * case SDLK_W: | |
85 * forward(); | |
86 * break; | |
87 * case SDLK_A: | |
88 * left(); | |
89 * break; | |
90 * ... | |
91 * } | |
92 * \endcode | |
93 * For keys based on mnemonics like "I for inventory" or "Z for zoom", use | |
94 * layout key codes, so that the key labeled "Z" will zoom, whether it's at the | |
95 * bottom left of the keyboard like on a US layout, or in the upper center like | |
96 * on a German layout (but keep in mind that this forces your users to use a | |
97 * keyboard layout where there \e is an I or Z key): | |
98 * \code | |
99 * print("To open the inventory, press the %s key.", SDL_GetKeyName('i')); | |
100 * ... | |
101 * switch (SDL_GetLayoutKey(event.key.keysym.sym)) { | |
102 * case 'i': | |
103 * inventory(); | |
104 * break; | |
105 * case 'z': | |
106 * zoom(); | |
107 * break; | |
108 * ... | |
109 * } | |
110 * \endcode | |
111 * Of course, in a real application, you should not hardcode your key | |
112 * assignments like this, but make them user-configurable. | |
113 */ | 42 */ |
114 typedef Uint32 SDLKey; | 43 typedef Sint32 SDLKey; |
115 | 44 |
116 #define SDL_KEY_CAN_BE_PHYSICAL_BIT (1<<24) /* marks SDLKeys from the "physical" set (some of these are also in the "layout" set) */ | 45 #define SDLK_SCANCODE_MASK (1<<30) |
117 #define SDL_KEY_KEYPAD_BIT (1<<25) /* marks keypad keys that need [] around their name to distinguish them from the corresponding keyboard keys */ | 46 #define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK) |
118 #define SDL_KEY_LAYOUT_SPECIAL_BIT (1<<26) /* marks non-physical layout keys that cannot be described by a single character */ | 47 |
119 | 48 enum |
120 /** Converts an \link ::SDLPhysicalKey SDLK_* \endlink constant to an index into the array obtained from SDL_GetKeyState(). */ | |
121 #define SDLK_INDEX(k) ((k) & 0x00FFFFFF) | |
122 | |
123 #define SDL_PHYSICAL_KEY(n) ((n) | SDL_KEY_CAN_BE_PHYSICAL_BIT) | |
124 | |
125 /** | |
126 * \brief SDL physical key codes. | |
127 * | |
128 * This is the set of physical key codes, i.e. the values of SDL_keysym::sym. | |
129 * Some of them (those for non-character keys) also appear as layout key codes. | |
130 * The constants are typically named after how the key would be labeled on a US | |
131 * keyboard, e.g. SDLK_A or SDLK_LEFTBRACKET refer to the keys used as A and [ | |
132 * on a US layout, but used as Q and ^ on a French layout. | |
133 * | |
134 * <em>enum SDLPhysicalKey</em> is not a useful type in its own right - the | |
135 * constants defined here are intended as values of the ::SDLKey type. The only | |
136 * reason for the enum to have a name at all is that otherwise it would be | |
137 * impossible to refer to it in the documentation. | |
138 * | |
139 * \sa SDLKey | |
140 * | |
141 * \par Notes for driver implementors: | |
142 * These constants and their numerical values are based on the USB HID usage | |
143 * tables, version 1.12 | |
144 * <http://www.usb.org/developers/devclass_docs/Hut1_12.pdf>, section "10 | |
145 * Keyboard/Keypad Page (0x07)". When deciding what code to generate for what | |
146 * key, the following rules can be used as guidelines: | |
147 * - A given key on a given keyboard should produce the same SDLK_* code, no | |
148 * matter what computer it is connected to, what OS runs on that computer, and | |
149 * what the keyboard layout settings in the OS are. For USB keyboards, that | |
150 * should be the code numerically corresponding to the key's USB usage code | |
151 * (with exceptions, see comments for specific constants). | |
152 * - Two keys on two different keyboards are considered "the same key" and | |
153 * should generate the same SDLK_* code if, when connected to the same | |
154 * computer, they are treated equally by the OS. For USB keyboards, that's | |
155 * generally the case when they generate the same USB usage code. Non-USB | |
156 * keyboards can probably be treated like USB keyboards of the same layout, if | |
157 * such exist. If not, and there's no possibility to determine the equivalence | |
158 * relation by transitivity from the above - in particular, on devices like | |
159 * phones or game consoles that don't have PC-style alphabetic keyboards - | |
160 * apply common sense. If none of the predefined codes fit, insert new ones at | |
161 * the end. | |
162 */ | |
163 enum SDLPhysicalKey | |
164 { | 49 { |
165 SDLK_FIRST_PHYSICAL = 0, /**< (not a key, just marks the lowest used value in this enum) */ | 50 SDLK_UNKNOWN = 0, |
166 SDLK_NONE = SDL_PHYSICAL_KEY(0), | 51 |
167 SDLK_UNKNOWN = SDL_PHYSICAL_KEY(1), /* Not from the USB spec, but this is a convenient place for it */ | 52 SDLK_RETURN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RETURN), |
168 | 53 SDLK_ESCAPE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ESCAPE), |
169 SDLK_A = SDL_PHYSICAL_KEY(4), | 54 SDLK_BACKSPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BACKSPACE), |
170 SDLK_B = SDL_PHYSICAL_KEY(5), | 55 SDLK_TAB = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_TAB), |
171 SDLK_C = SDL_PHYSICAL_KEY(6), | 56 SDLK_SPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SPACE), |
172 SDLK_D = SDL_PHYSICAL_KEY(7), | 57 |
173 SDLK_E = SDL_PHYSICAL_KEY(8), | 58 SDLK_CAPSLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK), |
174 SDLK_F = SDL_PHYSICAL_KEY(9), | 59 |
175 SDLK_G = SDL_PHYSICAL_KEY(10), | 60 SDLK_F1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1), |
176 SDLK_H = SDL_PHYSICAL_KEY(11), | 61 SDLK_F2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2), |
177 SDLK_I = SDL_PHYSICAL_KEY(12), | 62 SDLK_F3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F3), |
178 SDLK_J = SDL_PHYSICAL_KEY(13), | 63 SDLK_F4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F4), |
179 SDLK_K = SDL_PHYSICAL_KEY(14), | 64 SDLK_F5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F5), |
180 SDLK_L = SDL_PHYSICAL_KEY(15), | 65 SDLK_F6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F6), |
181 SDLK_M = SDL_PHYSICAL_KEY(16), | 66 SDLK_F7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F7), |
182 SDLK_N = SDL_PHYSICAL_KEY(17), | 67 SDLK_F8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F8), |
183 SDLK_O = SDL_PHYSICAL_KEY(18), | 68 SDLK_F9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F9), |
184 SDLK_P = SDL_PHYSICAL_KEY(19), | 69 SDLK_F10 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F10), |
185 SDLK_Q = SDL_PHYSICAL_KEY(20), | 70 SDLK_F11 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F11), |
186 SDLK_R = SDL_PHYSICAL_KEY(21), | 71 SDLK_F12 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F12), |
187 SDLK_S = SDL_PHYSICAL_KEY(22), | 72 |
188 SDLK_T = SDL_PHYSICAL_KEY(23), | 73 SDLK_PRINTSCREEN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRINTSCREEN), |
189 SDLK_U = SDL_PHYSICAL_KEY(24), | 74 SDLK_SCROLLLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SCROLLLOCK), |
190 SDLK_V = SDL_PHYSICAL_KEY(25), | 75 SDLK_PAUSE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAUSE), |
191 SDLK_W = SDL_PHYSICAL_KEY(26), | 76 SDLK_INSERT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT), |
192 SDLK_X = SDL_PHYSICAL_KEY(27), | 77 SDLK_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME), |
193 SDLK_Y = SDL_PHYSICAL_KEY(28), | 78 SDLK_PAGEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP), |
194 SDLK_Z = SDL_PHYSICAL_KEY(29), | 79 SDLK_DELETE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DELETE), |
195 | 80 SDLK_END = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END), |
196 SDLK_1 = SDL_PHYSICAL_KEY(30), | 81 SDLK_PAGEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN), |
197 SDLK_2 = SDL_PHYSICAL_KEY(31), | 82 SDLK_RIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT), |
198 SDLK_3 = SDL_PHYSICAL_KEY(32), | 83 SDLK_LEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LEFT), |
199 SDLK_4 = SDL_PHYSICAL_KEY(33), | 84 SDLK_DOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN), |
200 SDLK_5 = SDL_PHYSICAL_KEY(34), | 85 SDLK_UP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP), |
201 SDLK_6 = SDL_PHYSICAL_KEY(35), | 86 |
202 SDLK_7 = SDL_PHYSICAL_KEY(36), | 87 SDLK_NUMLOCKCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_NUMLOCKCLEAR), |
203 SDLK_8 = SDL_PHYSICAL_KEY(37), | 88 SDLK_KP_DIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DIVIDE), |
204 SDLK_9 = SDL_PHYSICAL_KEY(38), | 89 SDLK_KP_MULTIPLY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MULTIPLY), |
205 SDLK_0 = SDL_PHYSICAL_KEY(39), | 90 SDLK_KP_MINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MINUS), |
206 | 91 SDLK_KP_PLUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUS), |
207 SDLK_RETURN = SDL_PHYSICAL_KEY(40), | 92 SDLK_KP_ENTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_ENTER), |
208 SDLK_ESCAPE = SDL_PHYSICAL_KEY(41), | 93 SDLK_KP_1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_1), |
209 SDLK_BACKSPACE = SDL_PHYSICAL_KEY(42), | 94 SDLK_KP_2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_2), |
210 SDLK_TAB = SDL_PHYSICAL_KEY(43), | 95 SDLK_KP_3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_3), |
211 SDLK_SPACE = SDL_PHYSICAL_KEY(44), | 96 SDLK_KP_4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_4), |
212 | 97 SDLK_KP_5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_5), |
213 SDLK_HYPHENMINUS = SDL_PHYSICAL_KEY(45), | 98 SDLK_KP_6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_6), |
214 SDLK_EQUALS = SDL_PHYSICAL_KEY(46), | 99 SDLK_KP_7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_7), |
215 SDLK_LEFTBRACKET = SDL_PHYSICAL_KEY(47), | 100 SDLK_KP_8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_8), |
216 SDLK_RIGHTBRACKET = SDL_PHYSICAL_KEY(48), | 101 SDLK_KP_9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_9), |
217 SDLK_BACKSLASH = SDL_PHYSICAL_KEY(49), /**< Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. */ | 102 SDLK_KP_0 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_0), |
218 SDLK_NONUSHASH = SDL_PHYSICAL_KEY(50), /**< ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDLK_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. */ | 103 SDLK_KP_PERIOD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERIOD), |
219 SDLK_SEMICOLON = SDL_PHYSICAL_KEY(51), | 104 |
220 SDLK_APOSTROPHE = SDL_PHYSICAL_KEY(52), | 105 SDLK_APPLICATION = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APPLICATION), |
221 SDLK_GRAVE = SDL_PHYSICAL_KEY(53), /**< Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. */ | 106 SDLK_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_POWER), |
222 SDLK_COMMA = SDL_PHYSICAL_KEY(54), | 107 SDLK_KP_EQUALS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALS), |
223 SDLK_PERIOD = SDL_PHYSICAL_KEY(55), | 108 SDLK_F13 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F13), |
224 SDLK_SLASH = SDL_PHYSICAL_KEY(56), | 109 SDLK_F14 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F14), |
225 | 110 SDLK_F15 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F15), |
226 SDLK_CAPSLOCK = SDL_PHYSICAL_KEY(57), | 111 SDLK_F16 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F16), |
227 | 112 SDLK_F17 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F17), |
228 SDLK_F1 = SDL_PHYSICAL_KEY(58), | 113 SDLK_F18 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F18), |
229 SDLK_F2 = SDL_PHYSICAL_KEY(59), | 114 SDLK_F19 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F19), |
230 SDLK_F3 = SDL_PHYSICAL_KEY(60), | 115 SDLK_F20 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F20), |
231 SDLK_F4 = SDL_PHYSICAL_KEY(61), | 116 SDLK_F21 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F21), |
232 SDLK_F5 = SDL_PHYSICAL_KEY(62), | 117 SDLK_F22 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F22), |
233 SDLK_F6 = SDL_PHYSICAL_KEY(63), | 118 SDLK_F23 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F23), |
234 SDLK_F7 = SDL_PHYSICAL_KEY(64), | 119 SDLK_F24 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F24), |
235 SDLK_F8 = SDL_PHYSICAL_KEY(65), | 120 SDLK_EXECUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXECUTE), |
236 SDLK_F9 = SDL_PHYSICAL_KEY(66), | 121 SDLK_HELP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HELP), |
237 SDLK_F10 = SDL_PHYSICAL_KEY(67), | 122 SDLK_MENU = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MENU), |
238 SDLK_F11 = SDL_PHYSICAL_KEY(68), | 123 SDLK_SELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SELECT), |
239 SDLK_F12 = SDL_PHYSICAL_KEY(69), | 124 SDLK_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_STOP), |
240 | 125 SDLK_AGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AGAIN), |
241 SDLK_PRINTSCREEN = SDL_PHYSICAL_KEY(70), | 126 SDLK_UNDO = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UNDO), |
242 SDLK_SCROLLLOCK = SDL_PHYSICAL_KEY(71), | 127 SDLK_CUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CUT), |
243 SDLK_PAUSE = SDL_PHYSICAL_KEY(72), | 128 SDLK_COPY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COPY), |
244 SDLK_INSERT = SDL_PHYSICAL_KEY(73), /**< insert on PC, help on some Mac keyboards (but does send code 73, not 117) */ | 129 SDLK_PASTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PASTE), |
245 SDLK_HOME = SDL_PHYSICAL_KEY(74), | 130 SDLK_FIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_FIND), |
246 SDLK_PAGEUP = SDL_PHYSICAL_KEY(75), | 131 SDLK_MUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MUTE), |
247 SDLK_DELETE = SDL_PHYSICAL_KEY(76), | 132 SDLK_VOLUMEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEUP), |
248 SDLK_END = SDL_PHYSICAL_KEY(77), | 133 SDLK_VOLUMEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEDOWN), |
249 SDLK_PAGEDOWN = SDL_PHYSICAL_KEY(78), | 134 SDLK_KP_COMMA = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COMMA), |
250 SDLK_RIGHT = SDL_PHYSICAL_KEY(79), | 135 SDLK_KP_EQUALSAS400 = |
251 SDLK_LEFT = SDL_PHYSICAL_KEY(80), | 136 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALSAS400), |
252 SDLK_DOWN = SDL_PHYSICAL_KEY(81), | 137 |
253 SDLK_UP = SDL_PHYSICAL_KEY(82), | 138 SDLK_ALTERASE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ALTERASE), |
254 | 139 SDLK_SYSREQ = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SYSREQ), |
255 SDLK_KP_NUMLOCKCLEAR = SDL_PHYSICAL_KEY(83), /**< num lock on PC, clear on Mac keyboards */ | 140 SDLK_CANCEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CANCEL), |
256 SDLK_KP_DIVIDE = SDL_PHYSICAL_KEY(84) | SDL_KEY_KEYPAD_BIT, | 141 SDLK_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEAR), |
257 SDLK_KP_MULTIPLY = SDL_PHYSICAL_KEY(85) | SDL_KEY_KEYPAD_BIT, | 142 SDLK_PRIOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRIOR), |
258 SDLK_KP_MINUS = SDL_PHYSICAL_KEY(86) | SDL_KEY_KEYPAD_BIT, | 143 SDLK_RETURN2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RETURN2), |
259 SDLK_KP_PLUS = SDL_PHYSICAL_KEY(87) | SDL_KEY_KEYPAD_BIT, | 144 SDLK_SEPARATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SEPARATOR), |
260 SDLK_KP_ENTER = SDL_PHYSICAL_KEY(88), | 145 SDLK_OUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OUT), |
261 SDLK_KP_1 = SDL_PHYSICAL_KEY(89) | SDL_KEY_KEYPAD_BIT, | 146 SDLK_OPER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OPER), |
262 SDLK_KP_2 = SDL_PHYSICAL_KEY(90) | SDL_KEY_KEYPAD_BIT, | 147 SDLK_CLEARAGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEARAGAIN), |
263 SDLK_KP_3 = SDL_PHYSICAL_KEY(91) | SDL_KEY_KEYPAD_BIT, | 148 SDLK_CRSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CRSEL), |
264 SDLK_KP_4 = SDL_PHYSICAL_KEY(92) | SDL_KEY_KEYPAD_BIT, | 149 SDLK_EXSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXSEL), |
265 SDLK_KP_5 = SDL_PHYSICAL_KEY(93) | SDL_KEY_KEYPAD_BIT, | 150 |
266 SDLK_KP_6 = SDL_PHYSICAL_KEY(94) | SDL_KEY_KEYPAD_BIT, | 151 SDLK_KP_00 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_00), |
267 SDLK_KP_7 = SDL_PHYSICAL_KEY(95) | SDL_KEY_KEYPAD_BIT, | 152 SDLK_KP_000 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_000), |
268 SDLK_KP_8 = SDL_PHYSICAL_KEY(96) | SDL_KEY_KEYPAD_BIT, | 153 SDLK_THOUSANDSSEPARATOR = |
269 SDLK_KP_9 = SDL_PHYSICAL_KEY(97) | SDL_KEY_KEYPAD_BIT, | 154 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_THOUSANDSSEPARATOR), |
270 SDLK_KP_0 = SDL_PHYSICAL_KEY(98) | SDL_KEY_KEYPAD_BIT, | 155 SDLK_DECIMALSEPARATOR = |
271 SDLK_KP_PERIOD = SDL_PHYSICAL_KEY(99) | SDL_KEY_KEYPAD_BIT, | 156 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DECIMALSEPARATOR), |
272 | 157 SDLK_CURRENCYUNIT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYUNIT), |
273 SDLK_NONUSBACKSLASH = SDL_PHYSICAL_KEY(100), /**< This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. */ | 158 SDLK_CURRENCYSUBUNIT = |
274 SDLK_APPLICATION = SDL_PHYSICAL_KEY(101), /**< windows contextual menu, compose */ | 159 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYSUBUNIT), |
275 SDLK_POWER = SDL_PHYSICAL_KEY(102), /**< The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. */ | 160 SDLK_KP_LEFTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTPAREN), |
276 SDLK_KP_EQUALS = SDL_PHYSICAL_KEY(103) | SDL_KEY_KEYPAD_BIT, | 161 SDLK_KP_RIGHTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTPAREN), |
277 SDLK_F13 = SDL_PHYSICAL_KEY(104), | 162 SDLK_KP_LEFTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTBRACE), |
278 SDLK_F14 = SDL_PHYSICAL_KEY(105), | 163 SDLK_KP_RIGHTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTBRACE), |
279 SDLK_F15 = SDL_PHYSICAL_KEY(106), | 164 SDLK_KP_TAB = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_TAB), |
280 SDLK_F16 = SDL_PHYSICAL_KEY(107), | 165 SDLK_KP_BACKSPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BACKSPACE), |
281 SDLK_F17 = SDL_PHYSICAL_KEY(108), | 166 SDLK_KP_A = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_A), |
282 SDLK_F18 = SDL_PHYSICAL_KEY(109), | 167 SDLK_KP_B = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_B), |
283 SDLK_F19 = SDL_PHYSICAL_KEY(110), | 168 SDLK_KP_C = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_C), |
284 SDLK_F20 = SDL_PHYSICAL_KEY(111), | 169 SDLK_KP_D = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_D), |
285 SDLK_F21 = SDL_PHYSICAL_KEY(112), | 170 SDLK_KP_E = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_E), |
286 SDLK_F22 = SDL_PHYSICAL_KEY(113), | 171 SDLK_KP_F = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_F), |
287 SDLK_F23 = SDL_PHYSICAL_KEY(114), | 172 SDLK_KP_XOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_XOR), |
288 SDLK_F24 = SDL_PHYSICAL_KEY(115), | 173 SDLK_KP_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_POWER), |
289 SDLK_EXECUTE = SDL_PHYSICAL_KEY(116), | 174 SDLK_KP_PERCENT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERCENT), |
290 SDLK_HELP = SDL_PHYSICAL_KEY(117), | 175 SDLK_KP_LESS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LESS), |
291 SDLK_MENU = SDL_PHYSICAL_KEY(118), | 176 SDLK_KP_GREATER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_GREATER), |
292 SDLK_SELECT = SDL_PHYSICAL_KEY(119), | 177 SDLK_KP_AMPERSAND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AMPERSAND), |
293 SDLK_STOP = SDL_PHYSICAL_KEY(120), | 178 SDLK_KP_DBLAMPERSAND = |
294 SDLK_AGAIN = SDL_PHYSICAL_KEY(121), /*!< redo */ | 179 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLAMPERSAND), |
295 SDLK_UNDO = SDL_PHYSICAL_KEY(122), | 180 SDLK_KP_VERTICALBAR = |
296 SDLK_CUT = SDL_PHYSICAL_KEY(123), | 181 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_VERTICALBAR), |
297 SDLK_COPY = SDL_PHYSICAL_KEY(124), | 182 SDLK_KP_DBLVERTICALBAR = |
298 SDLK_PASTE = SDL_PHYSICAL_KEY(125), | 183 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLVERTICALBAR), |
299 SDLK_FIND = SDL_PHYSICAL_KEY(126), | 184 SDLK_KP_COLON = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COLON), |
300 SDLK_MUTE = SDL_PHYSICAL_KEY(127), | 185 SDLK_KP_HASH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HASH), |
301 SDLK_VOLUMEUP = SDL_PHYSICAL_KEY(128), | 186 SDLK_KP_SPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_SPACE), |
302 SDLK_VOLUMEDOWN = SDL_PHYSICAL_KEY(129), | 187 SDLK_KP_AT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AT), |
303 /* not sure whether there's a reason to enable these */ | 188 SDLK_KP_EXCLAM = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EXCLAM), |
304 /* SDLK_LOCKINGCAPSLOCK = SDL_PHYSICAL_KEY(130), */ | 189 SDLK_KP_MEMSTORE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSTORE), |
305 /* SDLK_LOCKINGNUMLOCK = SDL_PHYSICAL_KEY(131), */ | 190 SDLK_KP_MEMRECALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMRECALL), |
306 /* SDLK_LOCKINGSCROLLLOCK = SDL_PHYSICAL_KEY(132), */ | 191 SDLK_KP_MEMCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMCLEAR), |
307 SDLK_KP_COMMA = SDL_PHYSICAL_KEY(133) | SDL_KEY_KEYPAD_BIT, | 192 SDLK_KP_MEMADD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMADD), |
308 SDLK_KP_EQUALSAS400 = SDL_PHYSICAL_KEY(134) | SDL_KEY_KEYPAD_BIT, | 193 SDLK_KP_MEMSUBTRACT = |
309 | 194 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSUBTRACT), |
310 SDLK_INTERNATIONAL1 = SDL_PHYSICAL_KEY(135), /**< used on Asian keyboards, see footnotes in USB doc */ | 195 SDLK_KP_MEMMULTIPLY = |
311 SDLK_INTERNATIONAL2 = SDL_PHYSICAL_KEY(136), | 196 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMMULTIPLY), |
312 SDLK_INTERNATIONAL3 = SDL_PHYSICAL_KEY(137), /**< Yen */ | 197 SDLK_KP_MEMDIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMDIVIDE), |
313 SDLK_INTERNATIONAL4 = SDL_PHYSICAL_KEY(138), | 198 SDLK_KP_PLUSMINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUSMINUS), |
314 SDLK_INTERNATIONAL5 = SDL_PHYSICAL_KEY(139), | 199 SDLK_KP_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEAR), |
315 SDLK_INTERNATIONAL6 = SDL_PHYSICAL_KEY(140), | 200 SDLK_KP_CLEARENTRY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEARENTRY), |
316 SDLK_INTERNATIONAL7 = SDL_PHYSICAL_KEY(141), | 201 SDLK_KP_BINARY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BINARY), |
317 SDLK_INTERNATIONAL8 = SDL_PHYSICAL_KEY(142), | 202 SDLK_KP_OCTAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_OCTAL), |
318 SDLK_INTERNATIONAL9 = SDL_PHYSICAL_KEY(143), | 203 SDLK_KP_DECIMAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DECIMAL), |
319 SDLK_LANG1 = SDL_PHYSICAL_KEY(144), /**< Hangul/English toggle */ | 204 SDLK_KP_HEXADECIMAL = |
320 SDLK_LANG2 = SDL_PHYSICAL_KEY(145), /**< Hanja conversion */ | 205 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HEXADECIMAL), |
321 SDLK_LANG3 = SDL_PHYSICAL_KEY(146), /**< Katakana */ | 206 |
322 SDLK_LANG4 = SDL_PHYSICAL_KEY(147), /**< Hiragana */ | 207 SDLK_LCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LCTRL), |
323 SDLK_LANG5 = SDL_PHYSICAL_KEY(148), /**< Zenkaku/Hankaku */ | 208 SDLK_LSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LSHIFT), |
324 SDLK_LANG6 = SDL_PHYSICAL_KEY(149), /**< reserved */ | 209 SDLK_LALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LALT), |
325 SDLK_LANG7 = SDL_PHYSICAL_KEY(150), /**< reserved */ | 210 SDLK_LGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LGUI), |
326 SDLK_LANG8 = SDL_PHYSICAL_KEY(151), /**< reserved */ | 211 SDLK_RCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RCTRL), |
327 SDLK_LANG9 = SDL_PHYSICAL_KEY(152), /**< reserved */ | 212 SDLK_RSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RSHIFT), |
328 | 213 SDLK_RALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RALT), |
329 SDLK_ALTERASE = SDL_PHYSICAL_KEY(153), /**< Erase-Eaze */ | 214 SDLK_RGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RGUI), |
330 SDLK_SYSREQ = SDL_PHYSICAL_KEY(154), | 215 |
331 SDLK_CANCEL = SDL_PHYSICAL_KEY(155), | 216 SDLK_MODE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MODE), |
332 SDLK_CLEAR = SDL_PHYSICAL_KEY(156), | 217 |
333 SDLK_PRIOR = SDL_PHYSICAL_KEY(157), | 218 SDLK_AUDIONEXT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIONEXT), |
334 SDLK_RETURN2 = SDL_PHYSICAL_KEY(158), | 219 SDLK_AUDIOPREV = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPREV), |
335 SDLK_SEPARATOR = SDL_PHYSICAL_KEY(159), | 220 SDLK_AUDIOSTOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOSTOP), |
336 SDLK_OUT = SDL_PHYSICAL_KEY(160), | 221 SDLK_AUDIOPLAY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPLAY), |
337 SDLK_OPER = SDL_PHYSICAL_KEY(161), | 222 SDLK_AUDIOMUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOMUTE), |
338 SDLK_CLEARAGAIN = SDL_PHYSICAL_KEY(162), | 223 SDLK_MEDIASELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIASELECT), |
339 SDLK_CRSELPROPS = SDL_PHYSICAL_KEY(163), | 224 SDLK_MAIL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MAIL), |
340 SDLK_EXSEL = SDL_PHYSICAL_KEY(164), | 225 SDLK_CALCULATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALCULATOR), |
341 | 226 SDLK_COMPUTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COMPUTER), |
342 SDLK_KP_00 = SDL_PHYSICAL_KEY(176) | SDL_KEY_KEYPAD_BIT, | 227 SDLK_AC_SEARCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SEARCH), |
343 SDLK_KP_000 = SDL_PHYSICAL_KEY(177) | SDL_KEY_KEYPAD_BIT, | 228 SDLK_AC_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_HOME), |
344 SDLK_THOUSANDSSEPARATOR = SDL_PHYSICAL_KEY(178), | 229 SDLK_AC_BACK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BACK), |
345 SDLK_DECIMALSEPARATOR = SDL_PHYSICAL_KEY(179), | 230 SDLK_AC_FORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_FORWARD), |
346 SDLK_CURRENCYUNIT = SDL_PHYSICAL_KEY(180), | 231 SDLK_AC_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_STOP), |
347 SDLK_CURRENCYSUBUNIT = SDL_PHYSICAL_KEY(181), | 232 SDLK_AC_REFRESH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_REFRESH), |
348 SDLK_KP_LEFTPAREN = SDL_PHYSICAL_KEY(182) | SDL_KEY_KEYPAD_BIT, | 233 SDLK_AC_BOOKMARKS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BOOKMARKS), |
349 SDLK_KP_RIGHTPAREN = SDL_PHYSICAL_KEY(183) | SDL_KEY_KEYPAD_BIT, | 234 |
350 SDLK_KP_LEFTBRACE = SDL_PHYSICAL_KEY(184) | SDL_KEY_KEYPAD_BIT, | 235 SDLK_BRIGHTNESSDOWN = |
351 SDLK_KP_RIGHTBRACE = SDL_PHYSICAL_KEY(185) | SDL_KEY_KEYPAD_BIT, | 236 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSDOWN), |
352 SDLK_KP_TAB = SDL_PHYSICAL_KEY(186) | SDL_KEY_KEYPAD_BIT, | 237 SDLK_BRIGHTNESSUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSUP), |
353 SDLK_KP_BACKSPACE = SDL_PHYSICAL_KEY(187) | SDL_KEY_KEYPAD_BIT, | 238 SDLK_DISPLAYSWITCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DISPLAYSWITCH), |
354 SDLK_KP_A = SDL_PHYSICAL_KEY(188) | SDL_KEY_KEYPAD_BIT, | 239 SDLK_KBDILLUMTOGGLE = |
355 SDLK_KP_B = SDL_PHYSICAL_KEY(189) | SDL_KEY_KEYPAD_BIT, | 240 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMTOGGLE), |
356 SDLK_KP_C = SDL_PHYSICAL_KEY(190) | SDL_KEY_KEYPAD_BIT, | 241 SDLK_KBDILLUMDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMDOWN), |
357 SDLK_KP_D = SDL_PHYSICAL_KEY(191) | SDL_KEY_KEYPAD_BIT, | 242 SDLK_KBDILLUMUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMUP), |
358 SDLK_KP_E = SDL_PHYSICAL_KEY(192) | SDL_KEY_KEYPAD_BIT, | 243 SDLK_EJECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EJECT), |
359 SDLK_KP_F = SDL_PHYSICAL_KEY(193) | SDL_KEY_KEYPAD_BIT, | 244 SDLK_SLEEP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP), |
360 SDLK_KP_XOR = SDL_PHYSICAL_KEY(194) | SDL_KEY_KEYPAD_BIT, | |
361 SDLK_KP_POWER = SDL_PHYSICAL_KEY(195) | SDL_KEY_KEYPAD_BIT, | |
362 SDLK_KP_PERCENT = SDL_PHYSICAL_KEY(196) | SDL_KEY_KEYPAD_BIT, | |
363 SDLK_KP_LESS = SDL_PHYSICAL_KEY(197) | SDL_KEY_KEYPAD_BIT, | |
364 SDLK_KP_GREATER = SDL_PHYSICAL_KEY(198) | SDL_KEY_KEYPAD_BIT, | |
365 SDLK_KP_AMPERSAND = SDL_PHYSICAL_KEY(199) | SDL_KEY_KEYPAD_BIT, | |
366 SDLK_KP_DBLAMPERSAND = SDL_PHYSICAL_KEY(200) | SDL_KEY_KEYPAD_BIT, | |
367 SDLK_KP_VERTICALBAR = SDL_PHYSICAL_KEY(201) | SDL_KEY_KEYPAD_BIT, | |
368 SDLK_KP_DBLVERTICALBAR = SDL_PHYSICAL_KEY(202) | SDL_KEY_KEYPAD_BIT, | |
369 SDLK_KP_COLON = SDL_PHYSICAL_KEY(203) | SDL_KEY_KEYPAD_BIT, | |
370 SDLK_KP_HASH = SDL_PHYSICAL_KEY(204) | SDL_KEY_KEYPAD_BIT, | |
371 SDLK_KP_SPACE = SDL_PHYSICAL_KEY(205) | SDL_KEY_KEYPAD_BIT, | |
372 SDLK_KP_AT = SDL_PHYSICAL_KEY(206) | SDL_KEY_KEYPAD_BIT, | |
373 SDLK_KP_EXCLAM = SDL_PHYSICAL_KEY(207) | SDL_KEY_KEYPAD_BIT, | |
374 SDLK_KP_MEMSTORE = SDL_PHYSICAL_KEY(208) | SDL_KEY_KEYPAD_BIT, | |
375 SDLK_KP_MEMRECALL = SDL_PHYSICAL_KEY(209) | SDL_KEY_KEYPAD_BIT, | |
376 SDLK_KP_MEMCLEAR = SDL_PHYSICAL_KEY(210) | SDL_KEY_KEYPAD_BIT, | |
377 SDLK_KP_MEMADD = SDL_PHYSICAL_KEY(211) | SDL_KEY_KEYPAD_BIT, | |
378 SDLK_KP_MEMSUBTRACT = SDL_PHYSICAL_KEY(212) | SDL_KEY_KEYPAD_BIT, | |
379 SDLK_KP_MEMMULTIPLY = SDL_PHYSICAL_KEY(213) | SDL_KEY_KEYPAD_BIT, | |
380 SDLK_KP_MEMDIVIDE = SDL_PHYSICAL_KEY(214) | SDL_KEY_KEYPAD_BIT, | |
381 SDLK_KP_PLUSMINUS = SDL_PHYSICAL_KEY(215) | SDL_KEY_KEYPAD_BIT, | |
382 SDLK_KP_CLEAR = SDL_PHYSICAL_KEY(216) | SDL_KEY_KEYPAD_BIT, | |
383 SDLK_KP_CLEARENTRY = SDL_PHYSICAL_KEY(217) | SDL_KEY_KEYPAD_BIT, | |
384 SDLK_KP_BINARY = SDL_PHYSICAL_KEY(218) | SDL_KEY_KEYPAD_BIT, | |
385 SDLK_KP_OCTAL = SDL_PHYSICAL_KEY(219) | SDL_KEY_KEYPAD_BIT, | |
386 SDLK_KP_DECIMAL = SDL_PHYSICAL_KEY(220) | SDL_KEY_KEYPAD_BIT, | |
387 SDLK_KP_HEXADECIMAL = SDL_PHYSICAL_KEY(221) | SDL_KEY_KEYPAD_BIT, | |
388 | |
389 SDLK_LCTRL = SDL_PHYSICAL_KEY(224), | |
390 SDLK_LSHIFT = SDL_PHYSICAL_KEY(225), | |
391 SDLK_LALT = SDL_PHYSICAL_KEY(226), /**< alt, option */ | |
392 SDLK_LMETA = SDL_PHYSICAL_KEY(227), /**< windows, command (apple), meta */ | |
393 SDLK_RCTRL = SDL_PHYSICAL_KEY(228), | |
394 SDLK_RSHIFT = SDL_PHYSICAL_KEY(229), | |
395 SDLK_RALT = SDL_PHYSICAL_KEY(230), /**< alt gr, option */ | |
396 SDLK_RMETA = SDL_PHYSICAL_KEY(231), /**< windows, command (apple), meta */ | |
397 | |
398 /* Everything below here is not from the USB spec */ | |
399 | |
400 SDLK_MODE = SDL_PHYSICAL_KEY(232), /* I'm not sure if this is really not covered by any of the above, but since there's a special KMOD_MODE for it I'm adding it here */ | |
401 | |
402 SDLK_BRIGHTNESSDOWN = SDL_PHYSICAL_KEY(236), | |
403 SDLK_BRIGHTNESSUP = SDL_PHYSICAL_KEY(237), | |
404 SDLK_DISPLAYSWITCH = SDL_PHYSICAL_KEY(238), /**< display mirroring/dual display switch, video mode switch */ | |
405 SDLK_KBDILLUMTOGGLE = SDL_PHYSICAL_KEY(239), | |
406 SDLK_KBDILLUMDOWN = SDL_PHYSICAL_KEY(240), | |
407 SDLK_KBDILLUMUP = SDL_PHYSICAL_KEY(241), | |
408 SDLK_EJECT = SDL_PHYSICAL_KEY(242), | |
409 SDLK_SLEEP = SDL_PHYSICAL_KEY(243), | |
410 | |
411 /* Some of the more common and more standardized "multimedia"/"internet" keyboard keys */ | |
412 SDLK_AUDIOPLAY = SDL_PHYSICAL_KEY(244), | |
413 SDLK_AUDIOSTOP = SDL_PHYSICAL_KEY(245), | |
414 SDLK_AUDIOPREV = SDL_PHYSICAL_KEY(246), | |
415 SDLK_AUDIONEXT = SDL_PHYSICAL_KEY(247), | |
416 SDLK_CALC = SDL_PHYSICAL_KEY(248), | |
417 SDLK_WWW = SDL_PHYSICAL_KEY(249), | |
418 SDLK_EMAIL = SDL_PHYSICAL_KEY(250), | |
419 SDLK_MEDIA = SDL_PHYSICAL_KEY(251), | |
420 SDLK_COMPUTER = SDL_PHYSICAL_KEY(252), | |
421 SDLK_SEARCH = SDL_PHYSICAL_KEY(253), | |
422 SDLK_BOOKMARKS = SDL_PHYSICAL_KEY(254), | |
423 SDLK_BROWSERBACK = SDL_PHYSICAL_KEY(255), | |
424 SDLK_BROWSERFORWARD = SDL_PHYSICAL_KEY(256), | |
425 SDLK_BROWSERRELOAD = SDL_PHYSICAL_KEY(257), | |
426 SDLK_BROWSERSTOP = SDL_PHYSICAL_KEY(258), | |
427 | |
428 /* Add any other keys here */ | |
429 | |
430 SDLK_LAST_PHYSICAL /**< (not a key, just marks the highest used value in this enum) */ | |
431 }; | 245 }; |
432 | |
433 #define SDLK_FIRST SDLK_INDEX(SDLK_FIRST_PHYSICAL) | |
434 #define SDLK_LAST SDLK_INDEX(SDLK_LAST_PHYSICAL) | |
435 | |
436 | |
437 | 246 |
438 /** | 247 /** |
439 * \enum SDLMod | 248 * \enum SDLMod |
440 * | 249 * |
441 * \brief Enumeration of valid key mods (possibly OR'd together) | 250 * \brief Enumeration of valid key mods (possibly OR'd together) |
447 KMOD_RSHIFT = 0x0002, | 256 KMOD_RSHIFT = 0x0002, |
448 KMOD_LCTRL = 0x0040, | 257 KMOD_LCTRL = 0x0040, |
449 KMOD_RCTRL = 0x0080, | 258 KMOD_RCTRL = 0x0080, |
450 KMOD_LALT = 0x0100, | 259 KMOD_LALT = 0x0100, |
451 KMOD_RALT = 0x0200, | 260 KMOD_RALT = 0x0200, |
452 KMOD_LMETA = 0x0400, | 261 KMOD_LGUI = 0x0400, |
453 KMOD_RMETA = 0x0800, | 262 KMOD_RGUI = 0x0800, |
454 KMOD_NUM = 0x1000, | 263 KMOD_NUM = 0x1000, |
455 KMOD_CAPS = 0x2000, | 264 KMOD_CAPS = 0x2000, |
456 KMOD_MODE = 0x4000, | 265 KMOD_MODE = 0x4000, |
457 KMOD_RESERVED = 0x8000 | 266 KMOD_RESERVED = 0x8000 |
458 } SDLMod; | 267 } SDLMod; |
459 | 268 |
460 #define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL) | 269 #define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL) |
461 #define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT) | 270 #define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT) |
462 #define KMOD_ALT (KMOD_LALT|KMOD_RALT) | 271 #define KMOD_ALT (KMOD_LALT|KMOD_RALT) |
463 #define KMOD_META (KMOD_LMETA|KMOD_RMETA) | 272 #define KMOD_GUI (KMOD_LGUI|KMOD_RGUI) |
464 | 273 |
465 #endif /* _SDL_keysym_h */ | 274 #endif /* _SDL_keysym_h */ |
275 | |
276 /* vi: set ts=4 sw=4 expandtab: */ |