mirror of
https://github.com/libsdl-org/SDL.git
synced 2024-11-24 11:23:35 +08:00
Use existing XUSB driver software PID 0x02a1 instead of PID 0x02fe
0x02fe is actually PID of Xbox Wireless Adapter for Windows 10 (Model 1790) and creates confusion. Here is USB descriptor dump: https://github.com/DJm00n/ControllersInfo/blob/master/xboxone/DescriptorDump_Adapter%20(Xbox%20Wireless%20Adapter%20for%20Windows).txt
This commit is contained in:
parent
581d1cab25
commit
c790572674
@ -2615,9 +2615,6 @@ SDL_GamepadType SDL_GetGamepadTypeFromVIDPID(Uint16 vendor, Uint16 product, cons
|
||||
} else if (vendor == 0x0001 && product == 0x0001) {
|
||||
type = SDL_GAMEPAD_TYPE_STANDARD;
|
||||
|
||||
} else if (vendor == USB_VENDOR_MICROSOFT && product == USB_PRODUCT_XBOX_ONE_XINPUT_CONTROLLER) {
|
||||
type = SDL_GAMEPAD_TYPE_XBOXONE;
|
||||
|
||||
} else if (vendor == USB_VENDOR_NINTENDO && product == USB_PRODUCT_NINTENDO_SWITCH_JOYCON_LEFT) {
|
||||
type = SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT;
|
||||
|
||||
|
@ -1174,7 +1174,7 @@ static SDL_bool HIDAPI_IsEquivalentToDevice(Uint16 vendor_id, Uint16 product_id,
|
||||
}
|
||||
|
||||
/* If we're looking for an XInput controller, match it against any other Xbox controller */
|
||||
if (product_id == USB_PRODUCT_XBOX_ONE_XINPUT_CONTROLLER) {
|
||||
if (product_id == USB_PRODUCT_XBOX360_XUSB_CONTROLLER) {
|
||||
if (device->type == SDL_GAMEPAD_TYPE_XBOX360 || device->type == SDL_GAMEPAD_TYPE_XBOXONE) {
|
||||
return SDL_TRUE;
|
||||
}
|
||||
|
@ -143,7 +143,6 @@
|
||||
#define USB_PRODUCT_XBOX_SERIES_X_POWERA_SPECTRA 0x4002
|
||||
#define USB_PRODUCT_XBOX_SERIES_X_VICTRIX_GAMBIT 0x02d6
|
||||
#define USB_PRODUCT_XBOX_ONE_XBOXGIP_CONTROLLER 0x02ff /* XBOXGIP driver software PID */
|
||||
#define USB_PRODUCT_XBOX_ONE_XINPUT_CONTROLLER 0x02fe /* Made up product ID for XInput */
|
||||
#define USB_PRODUCT_STEAM_VIRTUAL_GAMEPAD 0x11ff
|
||||
|
||||
/* USB usage pages */
|
||||
|
@ -301,7 +301,7 @@ static void AddXInputDevice(Uint8 userid, BYTE SubType, JoyStick_DeviceData **pC
|
||||
|
||||
#ifdef SDL_JOYSTICK_HIDAPI
|
||||
/* Since we're guessing about the VID/PID, use a hard-coded VID/PID to represent XInput */
|
||||
if (HIDAPI_IsDevicePresent(USB_VENDOR_MICROSOFT, USB_PRODUCT_XBOX_ONE_XINPUT_CONTROLLER, version, pNewJoystick->joystickname)) {
|
||||
if (HIDAPI_IsDevicePresent(USB_VENDOR_MICROSOFT, USB_PRODUCT_XBOX360_XUSB_CONTROLLER, version, pNewJoystick->joystickname)) {
|
||||
/* The HIDAPI driver is taking care of this device */
|
||||
SDL_free(pNewJoystick);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user