You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported in version: 2.0.12 Reported for operating system, platform: macOS 10.15, x86_64
Comments on the original bug report:
On 2020-08-11 13:18:39 +0000, wrote:
Created attachment 4435
Patch to move SDL_HIDAPI_JoystickDriver to be checked before SDL_DARWIN_JoystickDriver
If a USB connected PS4 gamepad is plugged into the mac while an SDL game is running you will receive two SDL_CONTROLLERDEVICEADDED messages for two new controllers. These will both be a copy of the new gamepad, and all button presses etc. will register on both controllers.
This still happens even if Bluetooth is disabled, so it's nothing to do with the joystick connecting twice through two channels.
It seems that the problem is that there are two drivers on Mac:
SDL_DARWIN_JoystickDriver
SDL_HIDAPI_JoystickDriver
And both of these detect and add the new controller, hence two controllers.
The problem seems to be that SDL_HIDAPI_JoystickDriver does NOT check to see if the new controller is a duplicate when adding it, whereas SDL_DARWIN_JoystickDriver does.
If I swap the order of drivers in SDL_joystick_drivers[], so the HIDAPI driver comes first then it solves the problem and the gamepad only appears once, as SDL_Darwin_JoystickDriver notices the duplication. This isn't a great fix though, as it essentially relies on the drivers being called in a specific order.
A proper fix would be to have SDL_HIDAPI_JoystickDriver check for duplicates.
On 2020-12-09 14:50:59 +0000, Sam Lantinga wrote:
This is fixed for the 2.0.14 release.
Thanks!
The text was updated successfully, but these errors were encountered:
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
Reported in version: 2.0.12
Reported for operating system, platform: macOS 10.15, x86_64
Comments on the original bug report:
On 2020-08-11 13:18:39 +0000, wrote:
On 2020-12-09 14:50:59 +0000, Sam Lantinga wrote:
The text was updated successfully, but these errors were encountered: