mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
Filter out problematic shortcut keys
This commit is contained in:
@@ -115,6 +115,19 @@ bool HasMainButtonMapping(const std::vector<InputMapping> &mappings) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static void RemoveKeyboardLetterKeys(std::vector<InputMapping> &mappings) {
|
||||
std::vector<InputMapping> 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<InputMapping> 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);
|
||||
|
||||
+2
-1
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user