Qt: Release held actions if they get rebound

This commit is contained in:
Vicki Pfau 2020-01-11 14:02:10 -08:00
parent ec4c91dbda
commit 83673cc521
2 changed files with 5 additions and 1 deletions

View File

@ -110,6 +110,7 @@ Other fixes:
- Qt: Fix undesired screen filtering when paused (fixes mgba.io/i/1602)
- Qt: Fix sprite view using wrong base address (fixes mgba.io/i/1603)
- Qt: Fix inability to clear default keybindings
- Qt: Release held actions if they get rebound
- Vita: Fix analog controls (fixes mgba.io/i/1554)
Misc:
- GB Memory: Support manual SRAM editing (fixes mgba.io/i/1580)

View File

@ -45,8 +45,11 @@ void ShortcutController::updateKey(const QString& name, int keySequence) {
void ShortcutController::updateKey(std::shared_ptr<Shortcut> item, int keySequence) {
int oldShortcut = item->shortcut();
if (m_actions->isHeld(item->name())) {
if (oldShortcut != keySequence && m_actions->isHeld(item->name())) {
if (oldShortcut > 0) {
if (item->action() && item->action()->booleanAction()) {
item->action()->booleanAction()(false);
}
m_heldKeys.take(oldShortcut);
}
if (keySequence > 0) {