Commit 65e07b38842acc74f7740247074c9962701f0ab4

Alex Szpakowski 2019-01-31T19:52:47

iOS/tvOS: fix support for SDL_GameControllerGetButton(controller, GUIDE) with MFi controllers (thanks Caleb!) Fixes bug #4463.

diff --git a/src/joystick/iphoneos/SDL_sysjoystick.m b/src/joystick/iphoneos/SDL_sysjoystick.m
index fe1a40a..4bb9395 100644
--- a/src/joystick/iphoneos/SDL_sysjoystick.m
+++ b/src/joystick/iphoneos/SDL_sysjoystick.m
@@ -530,6 +530,7 @@ IOS_MFIJoystickUpdate(SDL_Joystick * joystick)
                 gamepad.buttonX.isPressed, gamepad.buttonY.isPressed,
                 gamepad.leftShoulder.isPressed,
                 gamepad.rightShoulder.isPressed,
+                joystick->delayed_guide_button,
             };
 
             hatstate = IOS_MFIJoystickHatStateForDPad(gamepad.dpad);
@@ -557,6 +558,7 @@ IOS_MFIJoystickUpdate(SDL_Joystick * joystick)
                 gamepad.buttonX.isPressed, gamepad.buttonY.isPressed,
                 gamepad.leftShoulder.isPressed,
                 gamepad.rightShoulder.isPressed,
+                joystick->delayed_guide_button,
             };
 
             hatstate = IOS_MFIJoystickHatStateForDPad(gamepad.dpad);
@@ -583,6 +585,7 @@ IOS_MFIJoystickUpdate(SDL_Joystick * joystick)
             Uint8 buttons[] = {
                 gamepad.buttonA.isPressed,
                 gamepad.buttonX.isPressed,
+                joystick->delayed_guide_button,
             };
 
             for (i = 0; i < SDL_arraysize(buttons); i++) {