From 27d5719a40279617b9050a6467feaa5be5a990ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 5 May 2026 09:27:50 +0200 Subject: [PATCH] MainScreen/CwCheatScreen: Don't ask for keyboard input if the keyboard is "soft" Fixes bug reported in the comments of #21637 --- UI/CwCheatScreen.cpp | 5 +++++ UI/CwCheatScreen.h | 2 +- UI/MainScreen.cpp | 6 ++++++ UI/MainScreen.h | 2 +- UWP/PPSSPP_UWPMain.cpp | 4 ++++ 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/UI/CwCheatScreen.cpp b/UI/CwCheatScreen.cpp index 6bb01c99ab..216c70d01e 100644 --- a/UI/CwCheatScreen.cpp +++ b/UI/CwCheatScreen.cpp @@ -49,6 +49,11 @@ CwCheatScreen::~CwCheatScreen() { delete engine_; } +bool CwCheatScreen::WantsTextInput() const { + // We don't want to pop a software keyboard on the cheat screen, just for type-to-search. + return !System_GetPropertyBool(SYSPROP_KEYBOARD_IS_SOFT); +} + bool CwCheatScreen::TryLoadCheatInfo() { std::shared_ptr info = g_gameInfoCache->GetInfo(nullptr, gamePath_, GameInfoFlags::PARAM_SFO); std::string gameID; diff --git a/UI/CwCheatScreen.h b/UI/CwCheatScreen.h index 72849b7823..6922aa26b6 100644 --- a/UI/CwCheatScreen.h +++ b/UI/CwCheatScreen.h @@ -50,7 +50,7 @@ public: const char *tag() const override { return "CwCheat"; } - bool WantsTextInput() const override { return true; } + bool WantsTextInput() const override; protected: void BeforeCreateViews() override; diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index b4cdb6fb97..5723ef7fae 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -125,6 +125,12 @@ MainScreen::~MainScreen() { g_BackgroundAudio.SetGame(Path()); } +bool MainScreen::WantsTextInput() const { + // We don't want to pop a software keyboard on the main screen, just for type-to-search. + return !System_GetPropertyBool(SYSPROP_KEYBOARD_IS_SOFT); +} + + #if PPSSPP_PLATFORM(IOS) constexpr std::string_view getGamesUri = "https://www.ppsspp.org/getgames_ios"; constexpr std::string_view getHomebrewUri = "https://www.ppsspp.org/gethomebrew_ios"; diff --git a/UI/MainScreen.h b/UI/MainScreen.h index 72c1e3d41e..5c6f29f1e1 100644 --- a/UI/MainScreen.h +++ b/UI/MainScreen.h @@ -52,7 +52,7 @@ public: bool key(const KeyInput &touch) override; - bool WantsTextInput() const override { return true; } + bool WantsTextInput() const override; protected: ViewLayoutMode LayoutMode() const override { return ViewLayoutMode::IgnoreBottomInset; } diff --git a/UWP/PPSSPP_UWPMain.cpp b/UWP/PPSSPP_UWPMain.cpp index 838fa9e367..6101f96feb 100644 --- a/UWP/PPSSPP_UWPMain.cpp +++ b/UWP/PPSSPP_UWPMain.cpp @@ -501,6 +501,10 @@ bool System_GetPropertyBool(SystemProperty prop) { // I don't know any possible way to display input dialog in non-xaml apps return isKeyboardAvailable() || isTouchAvailable(); } + case SYSPROP_KEYBOARD_IS_SOFT: + { + return IsXBox(); + } case SYSPROP_DEBUGGER_PRESENT: return IsDebuggerPresent(); case SYSPROP_OK_BUTTON_LEFT: