Qt: Fix analog buttons not getting unmapped

This commit is contained in:
Jeffrey Pfau 2015-07-25 22:02:16 -07:00
parent 24a910c9d3
commit 8c1194244d
4 changed files with 10 additions and 0 deletions

View File

@ -63,6 +63,7 @@ Bugfixes:
- Qt: Fix window being too tall after exiting fullscreen - Qt: Fix window being too tall after exiting fullscreen
- Qt: Fix a missing va_end call in the log handler lambda within the GameController constructor - Qt: Fix a missing va_end call in the log handler lambda within the GameController constructor
- GBA Cheats: Fix Pro Action Replay and GameShark issues when used together - GBA Cheats: Fix Pro Action Replay and GameShark issues when used together
- Qt: Fix analog buttons not getting unmapped
Misc: Misc:
- Qt: Handle saving input settings better - Qt: Handle saving input settings better
- Debugger: Free watchpoints in addition to breakpoints - Debugger: Free watchpoints in addition to breakpoints

View File

@ -197,6 +197,10 @@ void GBAKeyEditor::setNext() {
} }
void GBAKeyEditor::save() { void GBAKeyEditor::save() {
#ifdef BUILD_SDL
m_controller->unbindAllAxes(m_type);
#endif
bindKey(m_keyDU, GBA_KEY_UP); bindKey(m_keyDU, GBA_KEY_UP);
bindKey(m_keyDD, GBA_KEY_DOWN); bindKey(m_keyDD, GBA_KEY_DOWN);
bindKey(m_keyDL, GBA_KEY_LEFT); bindKey(m_keyDL, GBA_KEY_LEFT);

View File

@ -413,6 +413,10 @@ void InputController::bindAxis(uint32_t type, int axis, GamepadAxisEvent::Direct
GBAInputBindAxis(&m_inputMap, type, axis, &description); GBAInputBindAxis(&m_inputMap, type, axis, &description);
} }
void InputController::unbindAllAxes(uint32_t type) {
GBAInputUnbindAllAxes(&m_inputMap, type);
}
void InputController::testGamepad(int type) { void InputController::testGamepad(int type) {
auto activeAxes = activeGamepadAxes(type); auto activeAxes = activeGamepadAxes(type);
auto oldAxes = m_activeAxes; auto oldAxes = m_activeAxes;

View File

@ -60,6 +60,7 @@ public:
void recalibrateAxes(); void recalibrateAxes();
void bindAxis(uint32_t type, int axis, GamepadAxisEvent::Direction, GBAKey); void bindAxis(uint32_t type, int axis, GamepadAxisEvent::Direction, GBAKey);
void unbindAllAxes(uint32_t type);
QStringList connectedGamepads(uint32_t type) const; QStringList connectedGamepads(uint32_t type) const;
int gamepad(uint32_t type) const; int gamepad(uint32_t type) const;