Fixed bug 5355 - Add GameController Framework support to macOS

C.W. Betts

This patch adds support to the GameController framework on macOS Big Sur and later, adding support for MFi controllers as well as rumble support for PS4 and Xbox One. There is some code to make sure that the IOKit joystick handler doesn't include two controllers at once.

While the GameController framework is present in earlier versions of macOS, there was no public, approved way of checking if a specific IOHIDDevice is a controller that GameController could handle. This was changed in Big Sur.
This commit is contained in:
Sam Lantinga 2020-11-21 13:15:33 -08:00
parent 5e0644c15a
commit 1df593fb16
4 changed files with 67 additions and 24 deletions

View file

@ -144,6 +144,7 @@
#define SDL_JOYSTICK_HIDAPI 1
#define SDL_JOYSTICK_IOKIT 1
#define SDL_JOYSTICK_VIRTUAL 1
#define SDL_JOYSTICK_MFI 1
#define SDL_HAPTIC_IOKIT 1
/* Enable the dummy sensor driver */