Skip to content

Commit d04899f

Browse files
authored
Fix setting RGB without a player led (#13524)
There is a bug where SInput checks for player led capability before setting RGB. This means that if a controller does not have a player led, RGB commands are not sent.
1 parent 1749aba commit d04899f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/joystick/hidapi/SDL_hidapi_sinput.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -632,9 +632,7 @@ static bool HIDAPI_DriverSInput_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Jo
632632
{
633633
SDL_DriverSInput_Context *ctx = (SDL_DriverSInput_Context *)device->context;
634634

635-
if (ctx->player_leds_supported) {
636-
637-
// Set player number, finalizing the setup
635+
if (ctx->joystick_rgb_supported) {
638636
Uint8 joystickRGBCommand[SINPUT_DEVICE_REPORT_COMMAND_SIZE] = { SINPUT_DEVICE_REPORT_ID_OUTPUT_CMDDAT, SINPUT_DEVICE_COMMAND_JOYSTICKRGB, red, green, blue };
639637
int joystickRGBBytesWritten = SDL_hid_write(device->dev, joystickRGBCommand, SINPUT_DEVICE_REPORT_COMMAND_SIZE);
640638

0 commit comments

Comments
 (0)