Removed blacklist entries for devices that aren't game controllers, allow Steam Controllers
authorSam Lantinga <slouken@libsdl.org>
Fri, 20 Mar 2020 20:53:26 -0700
changeset 136618a949642b6eb
parent 13660 25927a14e406
child 13662 d32d92e782ab
Removed blacklist entries for devices that aren't game controllers, allow Steam Controllers
src/hidapi/windows/hid.c
     1.1 --- a/src/hidapi/windows/hid.c	Fri Mar 20 13:44:50 2020 -0700
     1.2 +++ b/src/hidapi/windows/hid.c	Fri Mar 20 20:53:26 2020 -0700
     1.3 @@ -73,6 +73,7 @@
     1.4  #define USAGE_JOYSTICK 0x0004
     1.5  #define USAGE_GAMEPAD 0x0005
     1.6  #define USAGE_MULTIAXISCONTROLLER 0x0008
     1.7 +#define USB_VENDOR_VALVE 0x28de
     1.8  
     1.9  #ifdef __cplusplus
    1.10  extern "C" {
    1.11 @@ -325,18 +326,6 @@
    1.12  		return 1;
    1.13  	}
    1.14  
    1.15 -	// Sound BlasterX G1 - Causes 10 second stalls when asking for manufacturer's string
    1.16 -	if ( vendor_id == 0x041E && product_id == 0x3249 )
    1.17 -	{
    1.18 -		return 1;
    1.19 -	}
    1.20 -
    1.21 -	// Apple Cinema HD display 30" - takes a long time to return the product string
    1.22 -	if ( vendor_id == 0x05AC && product_id == 0x9220 )
    1.23 -	{
    1.24 -		return 1;
    1.25 -	}
    1.26 -
    1.27  	return 0;
    1.28  }
    1.29  
    1.30 @@ -496,11 +485,13 @@
    1.31  
    1.32  			/* SDL Modification: Ignore the device if it's not a gamepad. This limits compatibility
    1.33  			   risk from devices that may respond poorly to our string queries below. */
    1.34 -			if (caps.UsagePage != USAGE_PAGE_GENERIC_DESKTOP) {
    1.35 -				goto cont_close;
    1.36 -			}
    1.37 -			if (caps.Usage != USAGE_JOYSTICK && caps.Usage != USAGE_GAMEPAD && caps.Usage != USAGE_MULTIAXISCONTROLLER) {
    1.38 -				goto cont_close;
    1.39 +			if (attrib.VendorID != USB_VENDOR_VALVE) {
    1.40 +				if (caps.UsagePage != USAGE_PAGE_GENERIC_DESKTOP) {
    1.41 +					goto cont_close;
    1.42 +				}
    1.43 +				if (caps.Usage != USAGE_JOYSTICK && caps.Usage != USAGE_GAMEPAD && caps.Usage != USAGE_MULTIAXISCONTROLLER) {
    1.44 +					goto cont_close;
    1.45 +				}
    1.46  			}
    1.47  
    1.48  			/* VID/PID match. Create the record. */