comparison include/SDL_compat.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 91e601d9df8b
comparison
equal deleted inserted replaced
2302:7ae1c419b626 2303:d87417504c75
128 SDL_GRAB_ON = 1 128 SDL_GRAB_ON = 1
129 } SDL_GrabMode; 129 } SDL_GrabMode;
130 130
131 struct SDL_SysWMinfo; 131 struct SDL_SysWMinfo;
132 132
133 /* Key codes 133 /* Obsolete or renamed key codes */
134 Note that the correspondences defined here are approximate at best because 134
135 the meaning of the event structure field that carries these values has 135 /* These key constants were renamed for clarity or consistency. */
136 changed: in SDL 1.2, it referred to the key's label in the current keyboard 136 #define SDLK_a 'a'
137 layout, whereas now it refers to a specific physical key on the keyboard, 137 #define SDLK_b 'b'
138 regardless of the keyboard layout setting. 138 #define SDLK_c 'c'
139 To get comparable behavior to SDL 1.2, code that uses any of the codes below 139 #define SDLK_d 'd'
140 in ways like "if (somekey == SDLK_EXCLAIM)" should be changed to the 140 #define SDLK_e 'e'
141 equivalent of "if (SDL_GetLayoutKey(somekey) == '!')". 141 #define SDLK_f 'f'
142 */ 142 #define SDLK_g 'g'
143 143 #define SDLK_h 'h'
144 /* These key constants were renamed for clarity or consistence. */ 144 #define SDLK_i 'i'
145 #define SDLK_QUOTE SDLK_APOSTROPHE 145 #define SDLK_j 'j'
146 #define SDLK_MINUS SDLK_HYPHENMINUS 146 #define SDLK_k 'k'
147 #define SDLK_BACKQUOTE SDLK_GRAVE 147 #define SDLK_l 'l'
148 #define SDLK_a SDLK_A 148 #define SDLK_m 'm'
149 #define SDLK_b SDLK_B 149 #define SDLK_n 'n'
150 #define SDLK_c SDLK_C 150 #define SDLK_o 'o'
151 #define SDLK_d SDLK_D 151 #define SDLK_p 'p'
152 #define SDLK_e SDLK_E 152 #define SDLK_q 'q'
153 #define SDLK_f SDLK_F 153 #define SDLK_r 'r'
154 #define SDLK_g SDLK_G 154 #define SDLK_s 's'
155 #define SDLK_h SDLK_H 155 #define SDLK_t 't'
156 #define SDLK_i SDLK_I 156 #define SDLK_u 'u'
157 #define SDLK_j SDLK_J 157 #define SDLK_v 'v'
158 #define SDLK_k SDLK_K 158 #define SDLK_w 'w'
159 #define SDLK_l SDLK_L 159 #define SDLK_x 'x'
160 #define SDLK_m SDLK_M 160 #define SDLK_y 'y'
161 #define SDLK_n SDLK_N 161 #define SDLK_z 'z'
162 #define SDLK_o SDLK_O 162 #define SDLK_QUOTE '\''
163 #define SDLK_p SDLK_P 163 #define SDLK_MINUS '-'
164 #define SDLK_q SDLK_Q 164 #define SDLK_BACKQUOTE '`'
165 #define SDLK_r SDLK_R 165 #define SDLK_EXCLAIM '!'
166 #define SDLK_s SDLK_S 166 #define SDLK_QUOTEDBL '"'
167 #define SDLK_t SDLK_T 167 #define SDLK_HASH '#'
168 #define SDLK_u SDLK_U 168 #define SDLK_DOLLAR '$'
169 #define SDLK_v SDLK_V 169 #define SDLK_AMPERSAND '&'
170 #define SDLK_w SDLK_W 170 #define SDLK_LEFTPAREN '('
171 #define SDLK_x SDLK_X 171 #define SDLK_RIGHTPAREN ')'
172 #define SDLK_y SDLK_Y 172 #define SDLK_ASTERISK '*'
173 #define SDLK_z SDLK_Z 173 #define SDLK_PLUS '+'
174 #define SDLK_COLON ':'
175 #define SDLK_LESS '<'
176 #define SDLK_GREATER '>'
177 #define SDLK_QUESTION '?'
178 #define SDLK_AT '@'
179 #define SDLK_CARET '^'
180 #define SDLK_UNDERSCORE '_'
174 #define SDLK_KP0 SDLK_KP_0 181 #define SDLK_KP0 SDLK_KP_0
175 #define SDLK_KP1 SDLK_KP_1 182 #define SDLK_KP1 SDLK_KP_1
176 #define SDLK_KP2 SDLK_KP_2 183 #define SDLK_KP2 SDLK_KP_2
177 #define SDLK_KP3 SDLK_KP_3 184 #define SDLK_KP3 SDLK_KP_3
178 #define SDLK_KP4 SDLK_KP_4 185 #define SDLK_KP4 SDLK_KP_4
179 #define SDLK_KP5 SDLK_KP_5 186 #define SDLK_KP5 SDLK_KP_5
180 #define SDLK_KP6 SDLK_KP_6 187 #define SDLK_KP6 SDLK_KP_6
181 #define SDLK_KP7 SDLK_KP_7 188 #define SDLK_KP7 SDLK_KP_7
182 #define SDLK_KP8 SDLK_KP_8 189 #define SDLK_KP8 SDLK_KP_8
183 #define SDLK_KP9 SDLK_KP_9 190 #define SDLK_KP9 SDLK_KP_9
184 #define SDLK_NUMLOCK SDLK_KP_NUMLOCKCLEAR 191 #define SDLK_NUMLOCK SDLK_NUMLOCKCLEAR
185 #define SDLK_SCROLLOCK SDLK_SCROLLLOCK 192 #define SDLK_SCROLLOCK SDLK_SCROLLLOCK
186 #define SDLK_PRINT SDLK_PRINTSCREEN 193 #define SDLK_PRINT SDLK_PRINTSCREEN
187 194
188 /* These key constants are obsoleted by the new keyboard handling, 195 /* The META modifier is equivalent to the GUI modifier from the USB standard */
189 their definitions here correspond to how they appear on a US 196 #define KMOD_LMETA KMOD_LGUI
190 keyboard. */ 197 #define KMOD_RMETA KMOD_RGUI
191 198 #define KMOD_META KMOD_GUI
192 #define SDLK_EXCLAIM SDLK_1
193 #define SDLK_QUOTEDBL SDLK_APOSTROPHE
194 #define SDLK_HASH SDLK_3
195 #define SDLK_DOLLAR SDLK_4
196 #define SDLK_AMPERSAND SDLK_7
197 #define SDLK_LEFTPAREN SDLK_9
198 #define SDLK_RIGHTPAREN SDLK_0
199 #define SDLK_ASTERISK SDLK_8
200 #define SDLK_PLUS SDLK_EQUALS
201 #define SDLK_COLON SDLK_SEMICOLON
202 #define SDLK_LESS SDLK_COMMA
203 #define SDLK_GREATER SDLK_PERIOD
204 #define SDLK_QUESTION SDLK_SLASH
205 #define SDLK_AT SDLK_2
206 #define SDLK_CARET SDLK_6
207 #define SDLK_UNDERSCORE SDLK_HYPHENMINUS
208 199
209 /* These keys don't appear in the USB specification (or at least not under those names). I'm unsure if the following assignments make sense or if these codes should be defined as actual additional SDLK_ constants. */ 200 /* These keys don't appear in the USB specification (or at least not under those names). I'm unsure if the following assignments make sense or if these codes should be defined as actual additional SDLK_ constants. */
210 #define SDLK_LSUPER SDLK_LMETA 201 #define SDLK_LSUPER SDLK_LMETA
211 #define SDLK_RSUPER SDLK_RMETA 202 #define SDLK_RSUPER SDLK_RMETA
212 #define SDLK_COMPOSE SDLK_APPLICATION 203 #define SDLK_COMPOSE SDLK_APPLICATION
266 SDL_Rect * dstrect); 257 SDL_Rect * dstrect);
267 extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay * overlay); 258 extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay * overlay);
268 extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void); 259 extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void);
269 extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval); 260 extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval);
270 extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval); 261 extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval);
262 extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable);
271 263
272 /* Ends C function definitions when using C++ */ 264 /* Ends C function definitions when using C++ */
273 #ifdef __cplusplus 265 #ifdef __cplusplus
274 /* *INDENT-OFF* */ 266 /* *INDENT-OFF* */
275 } 267 }