From 84f6bc41b871335c2a7fa01582c65323b049e7c0 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Mon, 9 Nov 2015 17:41:54 -0400 Subject: [PATCH] iOS: Fixed MFi game controller triggers to report the proper range of values. --- src/joystick/iphoneos/SDL_sysjoystick.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/joystick/iphoneos/SDL_sysjoystick.m b/src/joystick/iphoneos/SDL_sysjoystick.m index ec23bbd54..93f42b04b 100644 --- a/src/joystick/iphoneos/SDL_sysjoystick.m +++ b/src/joystick/iphoneos/SDL_sysjoystick.m @@ -463,10 +463,10 @@ SDL_SYS_MFIJoystickUpdate(SDL_Joystick * joystick) /* 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, 2, (Sint16) (gamepad.leftTrigger.value * 32767)); + SDL_PrivateJoystickAxis(joystick, 2, (Sint16) ((gamepad.leftTrigger.value * 65535) - 32768)); SDL_PrivateJoystickAxis(joystick, 3, (Sint16) (gamepad.rightThumbstick.xAxis.value * 32767)); SDL_PrivateJoystickAxis(joystick, 4, (Sint16) (gamepad.rightThumbstick.yAxis.value * -32767)); - SDL_PrivateJoystickAxis(joystick, 5, (Sint16) (gamepad.rightTrigger.value * 32767)); + SDL_PrivateJoystickAxis(joystick, 5, (Sint16) ((gamepad.rightTrigger.value * 65535) - 32768)); hatstate = SDL_SYS_MFIJoystickHatStateForDPad(gamepad.dpad);