Commit 1b7669374e1a92088dcec4017c61caa57d475b5d

Sam Lantinga 2022-03-08T09:58:24

Fixed the SDL controller type for USB_PRODUCT_XBOX_ONE_XINPUT_CONTROLLER

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c
index 30e1169..47c67c9 100644
--- a/src/joystick/SDL_joystick.c
+++ b/src/joystick/SDL_joystick.c
@@ -1944,6 +1944,9 @@ SDL_GetJoystickGameControllerType(const char *name, Uint16 vendor, Uint16 produc
         } else if (vendor == 0x0001 && product == 0x0001) {
             type = SDL_CONTROLLER_TYPE_UNKNOWN;
 
+        } else if (vendor == USB_VENDOR_MICROSOFT && product == USB_PRODUCT_XBOX_ONE_XINPUT_CONTROLLER) {
+            type = SDL_CONTROLLER_TYPE_XBOXONE;
+
         } else if ((vendor == USB_VENDOR_AMAZON && product == USB_PRODUCT_AMAZON_LUNA_CONTROLLER) ||
                    (vendor == BLUETOOTH_VENDOR_AMAZON && product == BLUETOOTH_PRODUCT_LUNA_CONTROLLER)) {
             type = SDL_CONTROLLER_TYPE_AMAZON_LUNA;