src/joystick/hidapi/SDL_hidapi_switch.c
changeset 13558 ed7c27865ea7
parent 13493 9ebdd8dfc588
child 13588 668a74d2aec1
equal deleted inserted replaced
13557:0e9384077170 13558:ed7c27865ea7
   243 }
   243 }
   244 
   244 
   245 static SDL_bool
   245 static SDL_bool
   246 HIDAPI_DriverSwitch_IsSupportedDevice(const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol)
   246 HIDAPI_DriverSwitch_IsSupportedDevice(const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol)
   247 {
   247 {
       
   248     /* The HORI Wireless Switch Pad enumerates as a HID device when connected via USB
       
   249        with the same VID/PID as when connected over Bluetooth but doesn't actually
       
   250        support communication over USB. The most reliable way to block this without allowing the
       
   251        controller to continually attempt to reconnect is to filter it out by manufactuer/product string.
       
   252        Note that the controller does have a different product string when connected over Bluetooth.
       
   253      */
       
   254     if (SDL_strcmp( name, "HORI Wireless Switch Pad" ) == 0) {
       
   255         return SDL_FALSE;
       
   256     }
   248     return (type == SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO);
   257     return (type == SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO);
   249 }
   258 }
   250 
   259 
   251 static const char *
   260 static const char *
   252 HIDAPI_DriverSwitch_GetDeviceName(Uint16 vendor_id, Uint16 product_id)
   261 HIDAPI_DriverSwitch_GetDeviceName(Uint16 vendor_id, Uint16 product_id)