Skip to content
Permalink
Browse files

iOS MFi game controllers: inverted the thumbstick y axis values to ma…

…tch the behavior of other controllers.
  • Loading branch information
slime73 committed Nov 9, 2015
1 parent cef2242 commit 7ce64372c8a54c8d9b3936cd669c84ddd8a959ce
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/joystick/iphoneos/SDL_sysjoystick.m
@@ -462,10 +462,10 @@ SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index)

/* Axis order matches the XInput Windows mappings. */
SDL_PrivateJoystickAxis(joystick, 0, (Sint16) (gamepad.leftThumbstick.xAxis.value * 32767));
SDL_PrivateJoystickAxis(joystick, 1, (Sint16) (gamepad.leftThumbstick.yAxis.value * 32767));
SDL_PrivateJoystickAxis(joystick, 1, (Sint16) (gamepad.leftThumbstick.yAxis.value * -32767));
SDL_PrivateJoystickAxis(joystick, 2, (Sint16) (gamepad.leftTrigger.value * 32767));
SDL_PrivateJoystickAxis(joystick, 3, (Sint16) (gamepad.rightThumbstick.xAxis.value * 32767));
SDL_PrivateJoystickAxis(joystick, 4, (Sint16) (gamepad.rightThumbstick.yAxis.value * 32767));
SDL_PrivateJoystickAxis(joystick, 4, (Sint16) (gamepad.rightThumbstick.yAxis.value * -32767));
SDL_PrivateJoystickAxis(joystick, 5, (Sint16) (gamepad.rightTrigger.value * 32767));

hatstate = SDL_SYS_MFIJoystickHatStateForDPad(gamepad.dpad);

0 comments on commit 7ce6437

Please sign in to comment.