keyboard topic

CategoryKeyboard

SDL keyboard management.

Please refer to the Best Keyboard Practices document for details on how best to accept keyboard input in various types of programs:

https://wiki.libsdl.org/SDL3/BestKeyboardPractices

Functions

sdlClearComposition(Pointer<SdlWindow> window) → bool keyboard
Dismiss the composition window/IME without disabling the subsystem.
sdlGetKeyboardFocus() → Pointer<SdlWindow> keyboard
Query the window which currently has keyboard focus.
sdlGetKeyboardNameForId(int instanceId) → String? keyboard
Get the name of a keyboard.
sdlGetKeyboards(Pointer<Int32> count) → Pointer<Uint32> keyboard
Get a list of currently connected keyboards.
sdlGetKeyboardState(Pointer<Int32> numkeys) → Pointer<Bool> keyboard
Get a snapshot of the current state of the keyboard.
sdlGetKeyFromName(String? name) → int keyboard
Get a key code from a human-readable name.
sdlGetKeyFromScancode(int scancode, int modstate, bool keyEvent) → int keyboard
Get the key code corresponding to the given scancode according to the current keyboard layout.
sdlGetKeyName(int key) → String? keyboard
Get a human-readable name for a key.
sdlGetModState() → int keyboard
Get the current key modifier state for the keyboard.
sdlGetScancodeFromKey(int key, Pointer<Uint16> modstate) → int keyboard
Get the scancode corresponding to the given key code according to the current keyboard layout.
sdlGetScancodeFromName(String? name) → int keyboard
Get a scancode from a human-readable name.
sdlGetScancodeName(int scancode) → String? keyboard
Get a human-readable name for a scancode.
sdlGetTextInputArea(Pointer<SdlWindow> window, Pointer<SdlRect> rect, Pointer<Int32> cursor) → bool keyboard
Get the area used to type Unicode text input.
sdlHasKeyboard() → bool keyboard
Return whether a keyboard is currently connected.
sdlHasScreenKeyboardSupport() → bool keyboard
Check whether the platform has screen keyboard support.
sdlResetKeyboard() → void keyboard
Clear the state of the keyboard.
sdlScreenKeyboardShown(Pointer<SdlWindow> window) → bool keyboard
Check whether the screen keyboard is shown for given window.
sdlSetModState(int modstate) → void keyboard
Set the current key modifier state for the keyboard.
sdlSetScancodeName(int scancode, String? name) → bool keyboard
Set a human-readable name for a scancode.
sdlSetTextInputArea(Pointer<SdlWindow> window, Pointer<SdlRect> rect, int cursor) → bool keyboard
Set the area used to type Unicode text input.
sdlStartTextInput(Pointer<SdlWindow> window) → bool keyboard
Start accepting Unicode text input events in a window.
sdlStartTextInputWithProperties(Pointer<SdlWindow> window, int props) → bool keyboard
Start accepting Unicode text input events in a window, with properties describing the input.
sdlStopTextInput(Pointer<SdlWindow> window) → bool keyboard
Stop receiving any text input events in a window.
sdlTextInputActive(Pointer<SdlWindow> window) → bool keyboard
Check whether or not Unicode text input events are enabled for a window.
sdlxGetKeyboards() → List<int> keyboard
Get a list of currently connected keyboards.
sdlxGetKeyboardState() → List<bool> keyboard
Get a snapshot of the current state of the keyboard.
sdlxGetTextInputArea(Pointer<SdlWindow> window) → ({int cursor, SdlxRect rect})? keyboard
Get the area used to type Unicode text input.
sdlxSetTextInputArea(Pointer<SdlWindow> window, SdlxRect rect, int cursor) → bool keyboard
Set the area used to type Unicode text input.