diff --git a/CHANGES b/CHANGES index 36f354ba7..d6339ab26 100644 --- a/CHANGES +++ b/CHANGES @@ -10,6 +10,7 @@ Other fixes: - 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: diff --git a/src/platform/qt/ShortcutController.cpp b/src/platform/qt/ShortcutController.cpp index bbb89255e..d401fd1ba 100644 --- a/src/platform/qt/ShortcutController.cpp +++ b/src/platform/qt/ShortcutController.cpp @@ -159,7 +159,11 @@ bool ShortcutController::eventFilter(QObject*, QEvent* event) { } 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 @@ bool ShortcutController::eventFilter(QObject*, QEvent* event) { 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 @@ bool ShortcutController::eventFilter(QObject*, QEvent* event) { } 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;