Skip to content

Commit

Permalink
ios: Fixed MFi guide button not being detected (thanks, Caleb!).
Browse files Browse the repository at this point in the history
Fixes Bugzilla #4721.
  • Loading branch information
icculus committed Jul 13, 2019
1 parent 70f0b09 commit 73536d9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/joystick/iphoneos/SDL_sysjoystick.m
Expand Up @@ -658,6 +658,7 @@ @interface GCMicroGamepad (SDL)
if (joystick->hwdata->button_mask & (1 << SDL_CONTROLLER_BUTTON_START)) { if (joystick->hwdata->button_mask & (1 << SDL_CONTROLLER_BUTTON_START)) {
if (joystick->hwdata->uses_pause_handler) { if (joystick->hwdata->uses_pause_handler) {
pause_button_index = button_count; pause_button_index = button_count;
buttons[button_count++] = joystick->delayed_guide_button;
} else { } else {
buttons[button_count++] = gamepad.buttonMenu.isPressed; buttons[button_count++] = gamepad.buttonMenu.isPressed;
} }
Expand Down Expand Up @@ -693,6 +694,7 @@ @interface GCMicroGamepad (SDL)
buttons[button_count++] = gamepad.leftShoulder.isPressed; buttons[button_count++] = gamepad.leftShoulder.isPressed;
buttons[button_count++] = gamepad.rightShoulder.isPressed; buttons[button_count++] = gamepad.rightShoulder.isPressed;
pause_button_index = button_count; pause_button_index = button_count;
buttons[button_count++] = joystick->delayed_guide_button;


hatstate = IOS_MFIJoystickHatStateForDPad(gamepad.dpad); hatstate = IOS_MFIJoystickHatStateForDPad(gamepad.dpad);


Expand Down Expand Up @@ -725,6 +727,7 @@ @interface GCMicroGamepad (SDL)
if (joystick->hwdata->button_mask & (1 << SDL_CONTROLLER_BUTTON_START)) { if (joystick->hwdata->button_mask & (1 << SDL_CONTROLLER_BUTTON_START)) {
if (joystick->hwdata->uses_pause_handler) { if (joystick->hwdata->uses_pause_handler) {
pause_button_index = button_count; pause_button_index = button_count;
buttons[button_count++] = joystick->delayed_guide_button;
} else { } else {
buttons[button_count++] = gamepad.buttonMenu.isPressed; buttons[button_count++] = gamepad.buttonMenu.isPressed;
} }
Expand Down

0 comments on commit 73536d9

Please sign in to comment.