mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-05 17:36:25 +00:00
Fixed duplicating a device between XInput and HIDAPI
This commit is contained in:
@@ -294,7 +294,8 @@ AddXInputDevice(Uint8 userid, BYTE SubType, JoyStick_DeviceData **pContext)
|
||||
}
|
||||
|
||||
#ifdef SDL_JOYSTICK_HIDAPI
|
||||
if (HIDAPI_IsDevicePresent(vendor, product, version, pNewJoystick->joystickname)) {
|
||||
/* 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)) {
|
||||
/* The HIDAPI driver is taking care of this device */
|
||||
SDL_free(pNewJoystick);
|
||||
return;
|
||||
|
Reference in New Issue
Block a user