Skip to content

Commit 34c045a

Browse files
committed
Fixed paddles on the Xbox Elite controller using the GIP driver
1 parent 0447c2f commit 34c045a

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/joystick/hidapi/SDL_hidapi_gip.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2185,9 +2185,6 @@ static bool HIDAPI_DriverGIP_InitDevice(SDL_HIDAPI_Device *device)
21852185
ctx->metadata.device.in_system_messages[0] = GIP_DEFAULT_IN_SYSTEM_MESSAGES;
21862186
ctx->metadata.device.out_system_messages[0] = GIP_DEFAULT_OUT_SYSTEM_MESSAGES;
21872187
ctx->reset_for_metadata = SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_GIP_RESET_FOR_METADATA, false);
2188-
if (device->vendor_id == USB_VENDOR_MICROSOFT && device->product_id == USB_PRODUCT_XBOX_ONE_ELITE_SERIES_1) {
2189-
ctx->paddle_format = GIP_PADDLES_XBE1;
2190-
}
21912188
GIP_HandleQuirks(ctx);
21922189

21932190
if (ctx->quirks & GIP_QUIRK_NO_HELLO) {
@@ -2229,12 +2226,19 @@ static bool HIDAPI_DriverGIP_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystic
22292226

22302227
// Initialize the joystick capabilities
22312228
joystick->nbuttons = 11;
2232-
if (device->vendor_id == USB_VENDOR_MICROSOFT && device->product_id == USB_PRODUCT_XBOX_ONE_ELITE_SERIES_2) {
2233-
ctx->paddle_offset = 14;
2234-
ctx->paddle_format = GIP_PADDLES_XBE2;
2235-
if (ctx->firmware_major_version == 5 && ctx->firmware_minor_version < 17) {
2236-
ctx->paddle_format = GIP_PADDLES_XBE2_RAW;
2229+
if (device->vendor_id == USB_VENDOR_MICROSOFT) {
2230+
if (device->product_id == USB_PRODUCT_XBOX_ONE_ELITE_SERIES_1) {
2231+
ctx->paddle_offset = 28;
2232+
ctx->paddle_format = GIP_PADDLES_XBE1;
2233+
} else if (device->product_id == USB_PRODUCT_XBOX_ONE_ELITE_SERIES_2) {
2234+
ctx->paddle_offset = 14;
2235+
ctx->paddle_format = GIP_PADDLES_XBE2;
2236+
if (ctx->firmware_major_version == 5 && ctx->firmware_minor_version < 17) {
2237+
ctx->paddle_format = GIP_PADDLES_XBE2_RAW;
2238+
}
22372239
}
2240+
}
2241+
if (ctx->paddle_offset > 0) {
22382242
ctx->paddle_idx = (Uint8) joystick->nbuttons;
22392243
joystick->nbuttons += 4;
22402244
}

0 commit comments

Comments
 (0)