Better fix to make sure we're only returning controllers from the HIDAPI joystick API

This commit is contained in:
Sam Lantinga 2018-08-31 18:10:21 -07:00
parent c217b37797
commit cd08cc2a4e
7 changed files with 19 additions and 16 deletions

View file

@ -214,16 +214,8 @@ static uint8_t GetPlaystationVolumeFromFloat(float fVolume)
}
static SDL_bool
HIDAPI_DriverPS4_IsSupportedDevice(Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, Uint16 usage_page, Uint16 usage)
HIDAPI_DriverPS4_IsSupportedDevice(Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number)
{
/* The Revolution Pro Controller and Razer Raiju expose multiple interfaces on Windows */
const Uint16 NACON_USB_VID = 0x146b;
const Uint16 RAZER_USB_VID = 0x1532;
if ((vendor_id == NACON_USB_VID || vendor_id == RAZER_USB_VID) &&
(usage_page != 0 && usage_page != 1)) {
return SDL_FALSE;
}
return SDL_IsJoystickPS4(vendor_id, product_id);
}