From 73536d93ea66c4736e36cc0567a6a41785d9b0be Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 12 Jul 2019 21:28:43 -0400 Subject: [PATCH] ios: Fixed MFi guide button not being detected (thanks, Caleb!). Fixes Bugzilla #4721. --- src/joystick/iphoneos/SDL_sysjoystick.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/joystick/iphoneos/SDL_sysjoystick.m b/src/joystick/iphoneos/SDL_sysjoystick.m index 9548b7d87..c50b6298a 100644 --- a/src/joystick/iphoneos/SDL_sysjoystick.m +++ b/src/joystick/iphoneos/SDL_sysjoystick.m @@ -658,6 +658,7 @@ IOS_MFIJoystickUpdate(SDL_Joystick * joystick) if (joystick->hwdata->button_mask & (1 << SDL_CONTROLLER_BUTTON_START)) { if (joystick->hwdata->uses_pause_handler) { pause_button_index = button_count; + buttons[button_count++] = joystick->delayed_guide_button; } else { buttons[button_count++] = gamepad.buttonMenu.isPressed; } @@ -693,6 +694,7 @@ IOS_MFIJoystickUpdate(SDL_Joystick * joystick) buttons[button_count++] = gamepad.leftShoulder.isPressed; buttons[button_count++] = gamepad.rightShoulder.isPressed; pause_button_index = button_count; + buttons[button_count++] = joystick->delayed_guide_button; hatstate = IOS_MFIJoystickHatStateForDPad(gamepad.dpad); @@ -725,6 +727,7 @@ IOS_MFIJoystickUpdate(SDL_Joystick * joystick) if (joystick->hwdata->button_mask & (1 << SDL_CONTROLLER_BUTTON_START)) { if (joystick->hwdata->uses_pause_handler) { pause_button_index = button_count; + buttons[button_count++] = joystick->delayed_guide_button; } else { buttons[button_count++] = gamepad.buttonMenu.isPressed; }