From 2fd3f756d251eb11d4e55099dffff8d8800786e8 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 28 Nov 2019 11:44:17 -0800 Subject: [PATCH] Fixed trying to use the HIDAPI driver for the original Xbox One S Bluetooth controller --- src/joystick/hidapi/SDL_hidapi_xboxone.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/joystick/hidapi/SDL_hidapi_xboxone.c b/src/joystick/hidapi/SDL_hidapi_xboxone.c index 4119b1ab4..536e1a0bc 100644 --- a/src/joystick/hidapi/SDL_hidapi_xboxone.c +++ b/src/joystick/hidapi/SDL_hidapi_xboxone.c @@ -171,11 +171,16 @@ IsBluetoothXboxOneController(Uint16 vendor_id, Uint16 product_id) { /* Check to see if it's the Xbox One S or Xbox One Elite Series 2 in Bluetooth mode */ const Uint16 USB_VENDOR_MICROSOFT = 0x045e; - const Uint16 USB_PRODUCT_XBOX_ONE_S = 0x02fd; + const Uint16 USB_PRODUCT_XBOX_ONE_S_REV1 = 0x02e0; + const Uint16 USB_PRODUCT_XBOX_ONE_S_REV2 = 0x02fd; const Uint16 USB_PRODUCT_XBOX_ONE_ELITE_SERIES_2 = 0x0b05; - if (vendor_id == USB_VENDOR_MICROSOFT && (product_id == USB_PRODUCT_XBOX_ONE_S || product_id == USB_PRODUCT_XBOX_ONE_ELITE_SERIES_2)) { - return SDL_TRUE; + if (vendor_id == USB_VENDOR_MICROSOFT) { + if (product_id == USB_PRODUCT_XBOX_ONE_S_REV1 || + product_id == USB_PRODUCT_XBOX_ONE_S_REV2 || + product_id == USB_PRODUCT_XBOX_ONE_ELITE_SERIES_2) { + return SDL_TRUE; + } } return SDL_FALSE; }