mirror of https://github.com/mgba-emu/mgba.git
Qt: Fix toggled actions on gamepads (fixes #1650)
This commit is contained in:
parent
ef5ef903fe
commit
8f46887535
1
CHANGES
1
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:
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue