| Summary: | [Patch] iOS MFi guide button not detected after latest game controller changes | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Caleb Cornett <spydog> |
| Component: | joystick | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | icculus |
| Version: | 2.0.10 | ||
| Hardware: | x86 | ||
| OS: | iOS 11 | ||
| Attachments: | Patch for the described issue | ||
This patch is now https://hg.libsdl.org/SDL/rev/68977584a5d9, thanks! --ryan. This is not right, that should have been handled here:
if (joystick->hwdata->uses_pause_handler) {
for (i = 0; i < joystick->hwdata->num_pause_presses; i++) {
SDL_PrivateJoystickButton(joystick, pause_button_index, SDL_PRESSED);
SDL_PrivateJoystickButton(joystick, pause_button_index, SDL_RELEASED);
updateplayerindex = YES;
}
joystick->hwdata->num_pause_presses = 0;
}
I tested this code with an MFi controller and it worked. Why didn't that work for you?
Perhaps I should have been more clear. SDL could detect the press as an SDL_CONTROLLERBUTTONDOWN event, but it could not detect the button when polling for it via SDL_GameControllerGetButton(). The use case is the same as this previously reported bug/patch: https://bugzilla.libsdl.org/show_bug.cgi?id=4463 Ah, got it, thanks! |
Created attachment 3879 [details] Patch for the described issue The changes made to support Xbox / PS4 controllers on iOS broke existing controllers' support for the guide button. No presses were being detected because the `buttons` array didn't contain an entry for the guide button. Attached is a patch that fixes the issue.