Qt: Only send button events if there is a widget in focus

This commit is contained in:
Jeffrey Pfau 2015-01-04 22:42:42 -08:00
parent ac686e3942
commit 4da22679b9
1 changed files with 3 additions and 0 deletions

View File

@ -194,6 +194,9 @@ void InputController::testGamepad() {
auto activeButtons = activeGamepadButtons();
auto oldButtons = m_activeButtons;
m_activeButtons = activeButtons;
if (!QApplication::focusWidget()) {
return;
}
activeButtons.subtract(oldButtons);
oldButtons.subtract(m_activeButtons);
for (int button : activeButtons) {