From 1b7669374e1a92088dcec4017c61caa57d475b5d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 8 Mar 2022 09:58:24 -0800 Subject: [PATCH] Fixed the SDL controller type for USB_PRODUCT_XBOX_ONE_XINPUT_CONTROLLER --- src/joystick/SDL_joystick.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index 30e1169e0..47c67c99d 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;