SDL 3.0
|
#include <SDL_events.h>
Data Fields | |
SDL_EventType | type |
Uint32 | reserved |
Uint64 | timestamp |
SDL_WindowID | windowID |
SDL_KeyboardID | which |
SDL_Scancode | scancode |
SDL_Keycode | key |
SDL_Keymod | mod |
Uint16 | raw |
Uint8 | state |
Uint8 | repeat |
Keyboard button event structure (event.key.*)
The key
is the base SDL_Keycode generated by pressing the scancode
using the current keyboard layout, applying any options specified in SDL_HINT_KEYCODE_OPTIONS. You can get the SDL_Keycode corresponding to the event scancode and modifiers directly from the keyboard layout, bypassing SDL_HINT_KEYCODE_OPTIONS, by calling SDL_GetKeyFromScancode().
Definition at line 333 of file SDL_events.h.
SDL_Keycode SDL_KeyboardEvent::key |
SDL virtual key code
Definition at line 341 of file SDL_events.h.
SDL_Keymod SDL_KeyboardEvent::mod |
current key modifiers
Definition at line 342 of file SDL_events.h.
Uint16 SDL_KeyboardEvent::raw |
The platform dependent scancode for this event
Definition at line 343 of file SDL_events.h.
Uint8 SDL_KeyboardEvent::repeat |
Non-zero if this is a key repeat
Definition at line 345 of file SDL_events.h.
Uint32 SDL_KeyboardEvent::reserved |
Definition at line 336 of file SDL_events.h.
SDL_Scancode SDL_KeyboardEvent::scancode |
SDL physical key code
Definition at line 340 of file SDL_events.h.
Uint8 SDL_KeyboardEvent::state |
SDL_PRESSED or SDL_RELEASED
Definition at line 344 of file SDL_events.h.
Uint64 SDL_KeyboardEvent::timestamp |
In nanoseconds, populated using SDL_GetTicksNS()
Definition at line 337 of file SDL_events.h.
SDL_EventType SDL_KeyboardEvent::type |
SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP
Definition at line 335 of file SDL_events.h.
SDL_KeyboardID SDL_KeyboardEvent::which |
The keyboard instance id, or 0 if unknown or virtual
Definition at line 339 of file SDL_events.h.
SDL_WindowID SDL_KeyboardEvent::windowID |
The window with keyboard focus, if any
Definition at line 338 of file SDL_events.h.