Qt: Fix toggled actions on gamepads (fixes #1650)
Vicki Pfau vi@endrift.com
Tue, 28 Jan 2020 18:13:39 -0800
2 files changed,
16 insertions(+),
3 deletions(-)
M
CHANGES
→
CHANGES
@@ -10,6 +10,7 @@ - Qt: Fix race condition with proxied video events
- Qt: Fix color selection in asset view (fixes mgba.io/i/1648) - Qt: Fix missing OSD messages - Qt: Fix crash unloading shaders + - Qt: Fix toggled actions on gamepads (fixes mgba.io/i/1650) 0.8.0: (2020-01-21) Features:
M
src/platform/qt/ShortcutController.cpp
→
src/platform/qt/ShortcutController.cpp
@@ -159,7 +159,11 @@ return false;
} Action* action = item.value()->action(); if (action) { - action->trigger(); + if (m_actions->isHeld(action->name())) { + action->trigger(true); + } else { + action->trigger(!action->isActive()); + } } event->accept(); return true;@@ -170,7 +174,7 @@ if (item == m_buttons.end()) {
return false; } Action* action = item.value()->action(); - if (action) { + if (action && m_actions->isHeld(action->name())) { action->trigger(false); } event->accept();@@ -184,7 +188,15 @@ return false;
} Action* action = item.value()->action(); if (action) { - action->trigger(gae->isNew()); + if (gae->isNew()) { + if (m_actions->isHeld(action->name())) { + action->trigger(true); + } else { + action->trigger(!action->isActive()); + } + } else if (m_actions->isHeld(action->name())) { + action->trigger(false); + } } event->accept(); return true;