KEYMAPPER: Allow joystick half axes to be remapped

This commit is contained in:
Bastien Bouclet 2020-02-08 11:19:16 +01:00 committed by rsn8887
parent eea70a3c8c
commit 2177e685b7
14 changed files with 233 additions and 104 deletions

View file

@ -148,7 +148,12 @@ Keymap::ActionArray Keymap::getMappedActions(const Event &event) const {
}
case EVENT_JOYBUTTON_DOWN:
case EVENT_JOYBUTTON_UP: {
HardwareInput hardwareInput = HardwareInput::createJoystick("", event.joystick.button, "");
HardwareInput hardwareInput = HardwareInput::createJoystickButton("", event.joystick.button, "");
return _hwActionMap[hardwareInput];
}
case EVENT_JOYAXIS_MOTION: {
bool positiveHalf = event.joystick.position >= 0;
HardwareInput hardwareInput = HardwareInput::createJoystickHalfAxis("", event.joystick.axis, positiveHalf, "");
return _hwActionMap[hardwareInput];
}
case EVENT_CUSTOM_BACKEND_HARDWARE: {