all repos — mgba @ cd2bb61b0e9c3f03f0f80a6d91c0165152130337

mGBA Game Boy Advance Emulator

Qt: Fix toggled actions on gamepads (fixes #1650)
Vicki Pfau vi@endrift.com
Tue, 28 Jan 2020 18:13:39 -0800
commit

cd2bb61b0e9c3f03f0f80a6d91c0165152130337

parent

e217a1fefb8b87de47a62422f42dfc6009591d2c

2 files changed, 16 insertions(+), 3 deletions(-)

jump to
M CHANGESCHANGES

@@ -18,6 +18,7 @@ - Qt: Force OpenGL paint engine creation thread (fixes mgba.io/i/1642)

- 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.cppsrc/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;