mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-04 11:45:18 +02:00
Fix an issue where stray KEY_UP events could confuse the control mapper into setting empty events
This had some not-so-good consequences, like inability to map anything in VR, and sometimes empty MultiMappings would result that we could end up asserting on before the previous commit.
This commit is contained in:
@@ -360,6 +360,13 @@ bool KeyMappingNewKeyDialog::key(const KeyInput &key) {
|
||||
}
|
||||
}
|
||||
if (key.flags & KEY_UP) {
|
||||
// If the key released wasn't part of the mapping, ignore it here. Some device can cause
|
||||
// stray key-up events.
|
||||
InputMapping upMapping(key.deviceId, key.keyCode);
|
||||
if (!mapping_.mappings.contains(upMapping)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (callback_)
|
||||
callback_(mapping_);
|
||||
TriggerFinish(DR_YES);
|
||||
@@ -391,7 +398,9 @@ bool KeyMappingNewMouseKeyDialog::key(const KeyInput &key) {
|
||||
}
|
||||
|
||||
mapped_ = true;
|
||||
|
||||
MultiInputMapping kdf(InputMapping(key.deviceId, key.keyCode));
|
||||
|
||||
TriggerFinish(DR_YES);
|
||||
g_Config.bMapMouse = false;
|
||||
if (callback_)
|
||||
|
||||
Reference in New Issue
Block a user