A structure that contains keyboard button event information.
Uint32 |
type |
the event type; SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP |
Uint32 |
timestamp |
timestamp of the event |
Uint32 |
windowID |
the window with keyboard focus, if any |
Uint8 |
state |
the state of the key; SDL_PRESSED or SDL_RELEASED |
Uint8 |
repeat |
non-zero if this is a key repeat |
keysym |
the SDL_Keysym representing the key that was pressed or released |
SDL_KeyboardEvent is a member of the SDL_Event union and is used when an event of type SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP is reported. You would access it through the event's key
field.
An SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP event occurs whenever a user presses or releases a button on a keyboard. The information on what key was pressed or released is in the keysym member.
CategoryStruct, CategoryEvents