v2026.6.4
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.

Keyboard

Handles keyboard operations

Operations

GetModState # function

Get the current key modifier state for the keyboard

function : GetModState() ~ Keymod

Return

TypeDescription
KeymodOR'd combination of the modifier keys for the keyboard

GetState # function

Get a snapshot of the current state of the keyboard

function : GetState() ~ Byte[]

Return

TypeDescription
Bytepointer to an array of key states. A value of 1 means that the key is pressed and a value of 0 means that it is not. Indexes into this array are obtained by using SDL_Scancode values

SetTextInputRect # function

Set the rectangle used to type Unicode text inputs

function : SetTextInputRect(rect:Rect) ~ Nil

Parameters

NameTypeDescription
rectRectRect structure representing the rectangle to receive text

StartTextInput # function

Start accepting Unicode text input events

function : StartTextInput() ~ Nil

StopTextInput # function

Stop accepting Unicode text input events

function : StopTextInput() ~ Nil