Start text input before showing the on-screen keyboard (thanks @sharkwouter!)

Fixes the on screen keyboard not sending an event the first time on PSP

Closes https://github.com/libsdl-org/SDL/pull/15950
This commit is contained in:
Sam Lantinga
2026-07-06 16:44:59 -07:00
parent bd55a6d67d
commit ce417a40cf

View File

@@ -5836,15 +5836,8 @@ bool SDL_StartTextInputWithProperties(SDL_Window *window, SDL_PropertiesID props
_this->SetTextInputProperties(_this, window, props);
}
// Show the on-screen keyboard, if desired
if (AutoShowingScreenKeyboard() && !SDL_ScreenKeyboardShown(window)) {
if (_this->ShowScreenKeyboard) {
_this->ShowScreenKeyboard(_this, window, props);
}
}
if (!window->text_input_active) {
// Finally start the text input system
// Start the text input system
if (_this->StartTextInput) {
if (!_this->StartTextInput(_this, window, props)) {
return false;
@@ -5852,6 +5845,13 @@ bool SDL_StartTextInputWithProperties(SDL_Window *window, SDL_PropertiesID props
}
window->text_input_active = true;
}
// Show the on-screen keyboard, if desired
if (AutoShowingScreenKeyboard() && !SDL_ScreenKeyboardShown(window)) {
if (_this->ShowScreenKeyboard) {
_this->ShowScreenKeyboard(_this, window, props);
}
}
return true;
}