mirror of https://github.com/mgba-emu/mgba.git
Qt: Only send button events if there is a widget in focus
This commit is contained in:
parent
ac686e3942
commit
4da22679b9
|
@ -194,6 +194,9 @@ void InputController::testGamepad() {
|
||||||
auto activeButtons = activeGamepadButtons();
|
auto activeButtons = activeGamepadButtons();
|
||||||
auto oldButtons = m_activeButtons;
|
auto oldButtons = m_activeButtons;
|
||||||
m_activeButtons = activeButtons;
|
m_activeButtons = activeButtons;
|
||||||
|
if (!QApplication::focusWidget()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
activeButtons.subtract(oldButtons);
|
activeButtons.subtract(oldButtons);
|
||||||
oldButtons.subtract(m_activeButtons);
|
oldButtons.subtract(m_activeButtons);
|
||||||
for (int button : activeButtons) {
|
for (int button : activeButtons) {
|
||||||
|
|
Loading…
Reference in New Issue