comparison src/video/x11/SDL_x11events.c @ 4560:95352c671a6e

Added support for keyboard repeat (only tested on Windows so far)
author Sam Lantinga <slouken@libsdl.org>
date Tue, 20 Jul 2010 23:25:24 -0700
parents 4d95152d9e39
children e2d46c5c7483
comparison
equal deleted inserted replaced
4559:f8c3870af5a2 4560:95352c671a6e
180 Status status = 0; 180 Status status = 0;
181 181
182 #ifdef DEBUG_XEVENTS 182 #ifdef DEBUG_XEVENTS
183 printf("KeyPress (X11 keycode = 0x%X)\n", xevent.xkey.keycode); 183 printf("KeyPress (X11 keycode = 0x%X)\n", xevent.xkey.keycode);
184 #endif 184 #endif
185 SDL_SendKeyboardKey(SDL_PRESSED, videodata->key_layout[keycode]); 185 /* FIXME: How do we tell if this was a key repeat? */
186 SDL_SendKeyboardKey(SDL_PRESSED, videodata->key_layout[keycode], SDL_FALSE);
186 #if 1 187 #if 1
187 if (videodata->key_layout[keycode] == SDLK_UNKNOWN) { 188 if (videodata->key_layout[keycode] == SDLK_UNKNOWN) {
188 int min_keycode, max_keycode; 189 int min_keycode, max_keycode;
189 XDisplayKeycodes(display, &min_keycode, &max_keycode); 190 XDisplayKeycodes(display, &min_keycode, &max_keycode);
190 keysym = XKeycodeToKeysym(display, keycode, 0); 191 keysym = XKeycodeToKeysym(display, keycode, 0);
215 KeyCode keycode = xevent.xkey.keycode; 216 KeyCode keycode = xevent.xkey.keycode;
216 217
217 #ifdef DEBUG_XEVENTS 218 #ifdef DEBUG_XEVENTS
218 printf("KeyRelease (X11 keycode = 0x%X)\n", xevent.xkey.keycode); 219 printf("KeyRelease (X11 keycode = 0x%X)\n", xevent.xkey.keycode);
219 #endif 220 #endif
220 SDL_SendKeyboardKey(SDL_RELEASED, videodata->key_layout[keycode]); 221 SDL_SendKeyboardKey(SDL_RELEASED, videodata->key_layout[keycode], SDL_FALSE);
221 } 222 }
222 break; 223 break;
223 224
224 /* Have we been iconified? */ 225 /* Have we been iconified? */
225 case UnmapNotify:{ 226 case UnmapNotify:{