comparison src/events/SDL_keyboard_c.h @ 2129:047245361002

Key repeat is handled by the OS, since text input is now decoupled from physical key events.
author Sam Lantinga <slouken@libsdl.org>
date Sat, 16 Jun 2007 15:32:04 +0000
parents c121d94672cb
children 4baee598306d
comparison
equal deleted inserted replaced
2128:04e9ad5318dc 2129:047245361002
37 /* Data common to all keyboards */ 37 /* Data common to all keyboards */
38 SDL_WindowID focus; 38 SDL_WindowID focus;
39 Uint16 modstate; 39 Uint16 modstate;
40 Uint8 keystate[SDLK_LAST]; 40 Uint8 keystate[SDLK_LAST];
41 41
42 struct
43 {
44 int firsttime; /* if we check against the delay or repeat value */
45 int delay; /* the delay before we start repeating */
46 int interval; /* the delay between key repeat events */
47 Uint32 timestamp; /* the time the first keydown event occurred */
48
49 SDL_Event evt; /* the event we are supposed to repeat */
50 } repeat;
51
52 void *driverdata; 42 void *driverdata;
53 }; 43 };
54 44
55 /* Used by the OS keyboard code to detect whether or not to do UNICODE */ 45 /* Used by the OS keyboard code to detect whether or not to do UNICODE */
56 #ifndef DEFAULT_UNICODE_TRANSLATION 46 #ifndef DEFAULT_UNICODE_TRANSLATION
83 SDLKey key); 73 SDLKey key);
84 74
85 /* Send keyboard text input for a keyboard at an index */ 75 /* Send keyboard text input for a keyboard at an index */
86 extern int SDL_SendKeyboardText(int index, const char *text); 76 extern int SDL_SendKeyboardText(int index, const char *text);
87 77
88 /* Used by the event loop to queue pending keyboard repeat events */
89 extern void SDL_CheckKeyRepeat(void);
90
91 /* Shutdown the keyboard subsystem */ 78 /* Shutdown the keyboard subsystem */
92 extern void SDL_KeyboardQuit(void); 79 extern void SDL_KeyboardQuit(void);
93 80
94 #endif /* _SDL_keyboard_c_h */ 81 #endif /* _SDL_keyboard_c_h */
95 82