Start accepting Unicode text input events in a window, with properties describing the input.
Defined in <SDL3/SDL_keyboard.h>
bool SDL_StartTextInputWithProperties(SDL_Window *window, SDL_PropertiesID props);
SDL_Window * | window | the window to enable text input. |
SDL_PropertiesID | props | the properties to use. |
(bool) Returns true on success or false on failure; call SDL_GetError() for more information.
This function will enable text input (SDL_EVENT_TEXT_INPUT and SDL_EVENT_TEXT_EDITING events) in the specified window. Please use this function paired with SDL_StopTextInput().
Text input events are not received by default.
On some platforms using this function shows the screen keyboard and/or activates an IME, which can prevent some key press events from being passed through.
These are the supported properties:
SDL_PROP_TEXTINPUT_TYPE_NUMBER
- an SDL_TextInputType value that describes text being input, defaults to SDL_TEXTINPUT_TYPE_TEXT.SDL_PROP_TEXTINPUT_CAPITALIZATION_NUMBER
SDL_PROP_TEXTINPUT_AUTOCORRECT_BOOLEAN
SDL_PROP_TEXTINPUT_MULTILINE_BOOLEAN
On Android you can directly specify the input type:
SDL_PROP_TEXTINPUT_ANDROID_INPUTTYPE_NUMBER
This function should only be called on the main thread.
This function is available since SDL 3.1.3.