Fix missing rumble/LED/gyro for PS4/PS5 controllers over Bluetooth#1133
Fix missing rumble/LED/gyro for PS4/PS5 controllers over Bluetooth#1133crocchetto wants to merge 2 commits into
Conversation
briaguya0
left a comment
There was a problem hiding this comment.
2 of the hints aren't needed, the other 2 we shouldn't set unconditionally.
i don't want people with ps4/ps5 controllers to need to power cycle them whenever they open soh and then want to play another game.
if we add these, it should be done in an opt-in way
| } | ||
|
|
||
| SDL_SetHint(SDL_HINT_JOYSTICK_THREAD, "1"); | ||
| SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4, "1"); |
There was a problem hiding this comment.
this should already be set
from https://wiki.libsdl.org/SDL2/SDL_HINT_JOYSTICK_HIDAPI_PS4
The default is the value of SDL_HINT_JOYSTICK_HIDAPI
from https://wiki.libsdl.org/SDL2/SDL_HINT_JOYSTICK_HIDAPI
"1": HIDAPI drivers are used (the default)
| SDL_SetHint(SDL_HINT_JOYSTICK_THREAD, "1"); | ||
| SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4, "1"); | ||
| SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, "1"); | ||
| SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5, "1"); |
There was a problem hiding this comment.
same as HIDAPI_PS4
from https://wiki.libsdl.org/SDL2/SDL_HINT_JOYSTICK_HIDAPI_PS5
The default is the value of SDL_HINT_JOYSTICK_HIDAPI
|
|
||
| SDL_SetHint(SDL_HINT_JOYSTICK_THREAD, "1"); | ||
| SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4, "1"); | ||
| SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, "1"); |
There was a problem hiding this comment.
This doesn't come without side-effects
from https://wiki.libsdl.org/SDL2/SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE
Extended input reports allow rumble on Bluetooth PS4 controllers, but break DirectInput handling for applications that don't use SDL.
Once extended reports are enabled, they can not be disabled without power cycling the controller.
| SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4, "1"); | ||
| SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, "1"); | ||
| SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5, "1"); | ||
| SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE, "1"); |
There was a problem hiding this comment.
same as HIDAPI_PS4_RUMBLE
Rumble, LED control, and gyro are unavailable when connected via Bluetooth because SDL2 gates them behind "extended input report" mode, off by default, which must be requested via hint before SDL_Init().
Tested on macOS 15.6.1, rumble/LED/gyro now work over Bluetooth.