SDL
SDL copied to clipboard
DualShock 3: SDL_SetGamepadLED -> That operation is not supported
Hi,
I'm using a DualShock 3 on SDL 3.2.14 on Win11 and the properties report SDL_PROP_GAMEPAD_CAP_RGB_LED_BOOLEAN and SDL_PROP_GAMEPAD_CAP_MONO_LED_BOOLEAN.
But whenever I call SDL_SetGamepadLED (generic call when the LEDs are available) it will return an error "That operation is not supported".
I'm using SDL_HINT_JOYSTICK_HIDAPI_PS3_SIXAXIS_DRIVER "1".
Is this a bug or an unsupported driver ? Why is it reporting the LED but then fails the call ?
The DS3 only has red player LED indicators, so the properties are clearly wrong in my opinion.
The mono LED property is only set by the Logitech driver, so I'm surprised that it's showing true for the DualShock 3 controller. Can you provide your full code?
https://github.com/RPCS3/rpcs3/blob/2d9a24d1d6ef0682cfed9ee04d411a8caac9f15a/rpcs3/Input/sdl_pad_handler.cpp#L815
https://github.com/RPCS3/rpcs3/blob/2d9a24d1d6ef0682cfed9ee04d411a8caac9f15a/rpcs3/Input/sdl_pad_handler.cpp#L268
Oh, I see the problem. You're checking SDL_HasProperty(), and that returns true, because the property exists, but is set to false.
Those calls should be:
info.has_led = SDL_GetBooleanProperty(property_id, SDL_PROP_GAMEPAD_CAP_RGB_LED_BOOLEAN, false);
Ah ... I remember. This code was part of the port from SDL2 to SDL3. The guide didn't say how to use the new properties, so I must've found that function instead