mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-07-09 10:49:41 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user