mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-03 19:25:18 +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);
|
||||
|
||||
Reference in New Issue
Block a user