Fix glitch when mapping analog inputs, caused by multiple TriggerFinish caused by stray analog axis events.

ADd some guards all over the place against the same thing.
This commit is contained in:
Henrik Rydgård committed 2023-05-06 15:33:28 +02:00
1 parent 23c24d2961
commit 311a1a0fe2
3 files changed
+18 -8

No files matched your search

+6
View File
@@ -337,6 +337,8 @@ void KeyMappingNewKeyDialog::CreatePopupContents(UI::ViewGroup *parent) {
}
bool KeyMappingNewKeyDialog::key(const KeyInput &key) {
if (ignoreInput_)
return true;
if (time_now_d() < delayUntil_)
return true;
if (key.flags & KEY_DOWN) {
@@ -390,6 +392,8 @@ void KeyMappingNewMouseKeyDialog::CreatePopupContents(UI::ViewGroup *parent) {
bool KeyMappingNewMouseKeyDialog::key(const KeyInput &key) {
if (mapped_)
return false;
if (ignoreInput_)
return true;
if (key.flags & KEY_DOWN) {
if (key.keyCode == NKCODE_ESCAPE) {
TriggerFinish(DR_OK);
@@ -428,6 +432,8 @@ void KeyMappingNewKeyDialog::axis(const AxisInput &axis) {
return;
if (IgnoreAxisForMapping(axis.axisId))
return;
if (ignoreInput_)
return;
if (axis.value > AXIS_BIND_THRESHOLD) {
InputMapping mapping(axis.deviceId, axis.axisId, 1);