v2026.5.3
All Bundles
Bundle SDL2 multimedia library for 2D graphics, input handling, audio playback, and window management. Core types: Window, Renderer, Texture, Surface, Event, and Mixer. Compile with -lib sdl2.

KeyboardEvent

Keyboard event

Operations

GetKeysym #

The Keysym instance representing the key that was pressed or released

method : public : GetKeysym() ~ Keysym

Return

TypeDescription
Keysymkey that was pressed or released

GetRepeat #

Get key repeat

method : public : GetRepeat() ~ Int

Return

TypeDescription
Intnon-zero if this is a key repeat

GetState #

Get the state of the key

method : public : GetState() ~ KeyState

Return

TypeDescription
KeyStateKeyState->SDL_PRESSED or KeyState->SDL_RELEASED

GetTimestamp #

Get the event type

method : public : GetTimestamp() ~ Int

Return

TypeDescription
IntEventType->SDL_KEYDOWN or EventType->SDL_KEYUP

GetType #

Get the event type

method : public : GetType() ~ Int

Return

TypeDescription
IntEventType->SDL_KEYDOWN or EventType->SDL_KEYUP

GetWindowID #

Get the timestamp of the event

method : public : GetWindowID() ~ Int

Return

TypeDescription
Inttimestamp of the event