Prevent the SPEEDLINK COMPETITION PRO joystick from switching into Android controller mode when enumerated over HID on Windows 10.
authorSam Lantinga <slouken@libsdl.org>
Thu, 22 Aug 2019 15:58:00 -0700
changeset 1303064d32e614d64
parent 13029 3e281c2da43a
child 13031 f933cb0c64c3
Prevent the SPEEDLINK COMPETITION PRO joystick from switching into Android controller mode when enumerated over HID on Windows 10.
src/hidapi/windows/hid.c
     1.1 --- a/src/hidapi/windows/hid.c	Thu Aug 22 19:23:52 2019 -0300
     1.2 +++ b/src/hidapi/windows/hid.c	Thu Aug 22 15:58:00 2019 -0700
     1.3 @@ -298,8 +298,19 @@
     1.4  
     1.5  int hid_blacklist(unsigned short vendor_id, unsigned short product_id)
     1.6  {
     1.7 -	return vendor_id == 0x1B1C && // (Corsair)
     1.8 -		product_id == 0x1B3D; // Gaming keyboard?  Causes deadlock when asking for device details
     1.9 +	// Corsair Gaming keyboard - Causes deadlock when asking for device details
    1.10 +	if ( vendor_id == 0x1B1C && product_id == 0x1B3D )
    1.11 +	{
    1.12 +		return 1;
    1.13 +	}
    1.14 +
    1.15 +	// SPEEDLINK COMPETITION PRO - turns into an Android controller when enumerated
    1.16 +	if ( vendor_id == 0x0738 && product_id == 0x2217 )
    1.17 +	{
    1.18 +		return 1;
    1.19 +	}
    1.20 +
    1.21 +	return 0;
    1.22  }
    1.23  
    1.24  struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned short vendor_id, unsigned short product_id)