mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-26 03:18:47 +02:00
Added the hint SDL_HINT_ENABLE_SCREEN_KEYBOARD to control whether the on-screen keyboard should be shown when text input is active
Fixes https://github.com/libsdl-org/SDL/issues/7160
This commit is contained in:
@@ -4294,9 +4294,11 @@ void SDL_StartTextInput(void)
|
||||
(void)SDL_EventState(SDL_TEXTEDITING, SDL_ENABLE);
|
||||
|
||||
/* Then show the on-screen keyboard, if any */
|
||||
window = SDL_GetFocusWindow();
|
||||
if (window && _this && _this->ShowScreenKeyboard) {
|
||||
_this->ShowScreenKeyboard(_this, window);
|
||||
if (SDL_GetHintBoolean(SDL_HINT_ENABLE_SCREEN_KEYBOARD, SDL_TRUE)) {
|
||||
window = SDL_GetFocusWindow();
|
||||
if (window && _this && _this->ShowScreenKeyboard) {
|
||||
_this->ShowScreenKeyboard(_this, window);
|
||||
}
|
||||
}
|
||||
|
||||
/* Finally start the text input system */
|
||||
@@ -4338,9 +4340,11 @@ void SDL_StopTextInput(void)
|
||||
}
|
||||
|
||||
/* Hide the on-screen keyboard, if any */
|
||||
window = SDL_GetFocusWindow();
|
||||
if (window && _this && _this->HideScreenKeyboard) {
|
||||
_this->HideScreenKeyboard(_this, window);
|
||||
if (SDL_GetHintBoolean(SDL_HINT_ENABLE_SCREEN_KEYBOARD, SDL_TRUE)) {
|
||||
window = SDL_GetFocusWindow();
|
||||
if (window && _this && _this->HideScreenKeyboard) {
|
||||
_this->HideScreenKeyboard(_this, window);
|
||||
}
|
||||
}
|
||||
|
||||
/* Finally disable text events */
|
||||
|
||||
Reference in New Issue
Block a user