Module keyboard

Available on crate feature dep_sdl3 only.
Expand description

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

Structs§

SDL_Capitalization
Auto capitalization type.
SDL_TextInputType
Text input type.

Constants§

SDL_CAPITALIZE_LETTERS
All letters will be capitalized
SDL_CAPITALIZE_NONE
No auto-capitalization will be done
SDL_CAPITALIZE_SENTENCES
The first letter of sentences will be capitalized
SDL_CAPITALIZE_WORDS
The first letter of words will be capitalized
SDL_PROP_TEXTINPUT_ANDROID_INPUTTYPE_NUMBER
SDL_PROP_TEXTINPUT_AUTOCORRECT_BOOLEAN
SDL_PROP_TEXTINPUT_CAPITALIZATION_NUMBER
SDL_PROP_TEXTINPUT_MULTILINE_BOOLEAN
SDL_PROP_TEXTINPUT_TYPE_NUMBER
SDL_TEXTINPUT_TYPE_NUMBER
The input is a number
SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_HIDDEN
The input is a secure PIN that is hidden
SDL_TEXTINPUT_TYPE_NUMBER_PASSWORD_VISIBLE
The input is a secure PIN that is visible
SDL_TEXTINPUT_TYPE_TEXT
The input is text
SDL_TEXTINPUT_TYPE_TEXT_EMAIL
The input is an e-mail address
SDL_TEXTINPUT_TYPE_TEXT_NAME
The input is a person’s name
SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_HIDDEN
The input is a secure password that is hidden
SDL_TEXTINPUT_TYPE_TEXT_PASSWORD_VISIBLE
The input is a secure password that is visible
SDL_TEXTINPUT_TYPE_TEXT_USERNAME
The input is a username

Functions§

SDL_ClearComposition
Dismiss the composition window/IME without disabling the subsystem.
SDL_GetKeyFromName
Get a key code from a human-readable name.
SDL_GetKeyFromScancode
Get the key code corresponding to the given scancode according to the current keyboard layout.
SDL_GetKeyName
Get a human-readable name for a key.
SDL_GetKeyboardFocus
Query the window which currently has keyboard focus.
SDL_GetKeyboardNameForID
Get the name of a keyboard.
SDL_GetKeyboardState
Get a snapshot of the current state of the keyboard.
SDL_GetKeyboards
Get a list of currently connected keyboards.
SDL_GetModState
Get the current key modifier state for the keyboard.
SDL_GetScancodeFromKey
Get the scancode corresponding to the given key code according to the current keyboard layout.
SDL_GetScancodeFromName
Get a scancode from a human-readable name.
SDL_GetScancodeName
Get a human-readable name for a scancode.
SDL_GetTextInputArea
Get the area used to type Unicode text input.
SDL_HasKeyboard
Return whether a keyboard is currently connected.
SDL_HasScreenKeyboardSupport
Check whether the platform has screen keyboard support.
SDL_ResetKeyboard
Clear the state of the keyboard.
SDL_ScreenKeyboardShown
Check whether the screen keyboard is shown for given window.
SDL_SetModState
Set the current key modifier state for the keyboard.
SDL_SetScancodeName
Set a human-readable name for a scancode.
SDL_SetTextInputArea
Set the area used to type Unicode text input.
SDL_StartTextInput
Start accepting Unicode text input events in a window.
SDL_StartTextInputWithProperties
Start accepting Unicode text input events in a window, with properties describing the input.
SDL_StopTextInput
Stop receiving any text input events in a window.
SDL_TextInputActive
Check whether or not Unicode text input events are enabled for a window.

Type Aliases§

SDL_KeyboardID
This is a unique ID for a keyboard for the time it is connected to the system, and is never reused for the lifetime of the application.