all repos — mgba @ 8f468875358d7e96a492e91db30fd62f35ee8cfd

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

8f468875358d7e96a492e91db30fd62f35ee8cfd

parent

ef5ef903fe2c2b9c3caab1da6107466e12fa731f

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

jump to
M CHANGESCHANGES

@@ -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.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;