From 388c94a56930447b575bd1a8776f18357171f194 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sun, 4 Jan 2015 22:30:23 -0800 Subject: [PATCH] Qt: Fix some cases where key mapping can break if focus is adjusted --- CHANGES | 1 + src/platform/qt/GBAKeyEditor.cpp | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 9d4b07fa3..8fba79cc2 100644 --- a/CHANGES +++ b/CHANGES @@ -24,6 +24,7 @@ Bugfixes: - Video: Fix FFmpeg crashing when the file extension is wrong - GBA Audio: Fix GB audio channels being too quiet (fixes #159) - Qt: Fix a race condition when a game crashes immediately + - Qt: Fix some cases where key mapping can break if focus is adjusted Misc: - Qt: Disable sync to video by default - GBA: Exit cleanly on FATAL if the port supports it diff --git a/src/platform/qt/GBAKeyEditor.cpp b/src/platform/qt/GBAKeyEditor.cpp index 601ae3653..470263908 100644 --- a/src/platform/qt/GBAKeyEditor.cpp +++ b/src/platform/qt/GBAKeyEditor.cpp @@ -151,14 +151,12 @@ void GBAKeyEditor::paintEvent(QPaintEvent* event) { } void GBAKeyEditor::setNext() { + findFocus(); + if (m_currentKey == m_keyOrder.end()) { return; } - if (!(*m_currentKey)->hasFocus()) { - m_currentKey = m_keyOrder.end(); - } - ++m_currentKey; if (m_currentKey != m_keyOrder.end()) { (*m_currentKey)->setFocus();