From b5bc36a37fbb778f7586193863fac3bd0a08e453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 14 Apr 2026 18:43:42 -0600 Subject: [PATCH] Filter out problematic shortcut keys --- Core/KeyMap.cpp | 19 +++++++++++++++++++ UI/GameBrowser.cpp | 3 ++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Core/KeyMap.cpp b/Core/KeyMap.cpp index 032678226a..2fe3842ed6 100644 --- a/Core/KeyMap.cpp +++ b/Core/KeyMap.cpp @@ -115,6 +115,19 @@ bool HasMainButtonMapping(const std::vector &mappings) { return false; } +static void RemoveKeyboardLetterKeys(std::vector &mappings) { + std::vector result; + for (auto &mapping : mappings) { + if (mapping.deviceId == DEVICE_ID_KEYBOARD) { + if (mapping.keyCode >= NKCODE_A && mapping.keyCode <= NKCODE_Z) { + continue; + } + } + result.push_back(mapping); + } + mappings = result; +} + // TODO: This is such a mess... void UpdateNativeMenuKeys() { std::vector confirmKeys, cancelKeys; @@ -194,6 +207,12 @@ void UpdateNativeMenuKeys() { } */ + // Remove keyboard letter keys from some arrays, as they will collide with text input for instant search. + RemoveKeyboardLetterKeys(tabLeft); + RemoveKeyboardLetterKeys(tabRight); + RemoveKeyboardLetterKeys(confirmKeys); + RemoveKeyboardLetterKeys(cancelKeys); + SetDPadKeys(upKeys, downKeys, leftKeys, rightKeys); SetConfirmCancelKeys(confirmKeys, cancelKeys); SetTabLeftRightKeys(tabLeft, tabRight); diff --git a/UI/GameBrowser.cpp b/UI/GameBrowser.cpp index c302b7c833..b9b016f3c0 100644 --- a/UI/GameBrowser.cpp +++ b/UI/GameBrowser.cpp @@ -825,7 +825,8 @@ bool SearchBar::Touch(const TouchInput &input) { // for the user to be able to get out of searches without knowing ESC (or backspacing the whole search string). if (input.flags & TouchInputFlags::DOWN) { if (bounds_.Contains(input.x, input.y)) { - OnCancel.Trigger(UI::EventParams{this}); + UI::EventParams params{this}; + OnCancel.Trigger(params); return true; } }