Qt: Fix controller axis querying

This commit is contained in:
Jeffrey Pfau 2015-04-17 00:57:37 -07:00
parent ee6c9f71c2
commit 6b975dcbd3
2 changed files with 3 additions and 1 deletions

View File

@ -24,6 +24,7 @@ Bugfixes:
- GBA: Add initial I/O register settings for background matrix registers - GBA: Add initial I/O register settings for background matrix registers
- Qt: Fix potential crash if a gamepad causes focus to change - Qt: Fix potential crash if a gamepad causes focus to change
- GBA Memory: Allow SRAM to be 64kB - GBA Memory: Allow SRAM to be 64kB
- Qt: Fix controller axis querying
Misc: Misc:
- Qt: Show multiplayer numbers in window title - Qt: Show multiplayer numbers in window title

View File

@ -285,13 +285,14 @@ void InputController::testGamepad() {
GamepadAxisEvent* event = new GamepadAxisEvent(axis.first, axis.second, newlyAboveThreshold, this); GamepadAxisEvent* event = new GamepadAxisEvent(axis.first, axis.second, newlyAboveThreshold, this);
if (newlyAboveThreshold) { if (newlyAboveThreshold) {
postPendingEvent(event->gbaKey()); postPendingEvent(event->gbaKey());
QApplication::sendEvent(QApplication::focusWidget(), event);
if (!event->isAccepted()) { if (!event->isAccepted()) {
clearPendingEvent(event->gbaKey()); clearPendingEvent(event->gbaKey());
} }
} else if (oldAxes.contains(axis)) { } else if (oldAxes.contains(axis)) {
clearPendingEvent(event->gbaKey()); clearPendingEvent(event->gbaKey());
QApplication::sendEvent(QApplication::focusWidget(), event);
} }
QApplication::sendEvent(QApplication::focusWidget(), event);
} }
if (!QApplication::focusWidget()) { if (!QApplication::focusWidget()) {