Просмотр исходного кода

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
Sam Lantinga 1 день назад
Родитель
Сommit
ce417a40cf
1 измененных файлов с 8 добавлено и 8 удалено
  1. 8 8
      src/video/SDL_video.c

+ 8 - 8
src/video/SDL_video.c

@@ -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;
 }