Fixed detecting Bluetooth Steam Controllers on Windows

This commit is contained in:
Sam Lantinga 2023-06-05 21:28:12 -07:00
parent 17c397f7ec
commit d032492aab

View File

@ -1058,8 +1058,14 @@ SDL_bool SDL_HIDAPI_ShouldIgnoreDevice(int bus, Uint16 vendor_id, Uint16 product
/* See if there are any devices we should skip in enumeration */
if (SDL_hidapi_only_controllers && usage_page) {
if (vendor_id == USB_VENDOR_VALVE) {
/* Ignore the USB mouse/keyboard interface on Steam Controllers */
if (bus == HID_API_BUS_USB &&
/* Ignore the mouse/keyboard interface on Steam Controllers */
if (
#ifdef __WIN32__
/* Check the usage page and usage on both USB and Bluetooth */
#else
/* Only check the usage page and usage on USB */
bus == HID_API_BUS_USB &&
#endif
usage_page == USB_USAGEPAGE_GENERIC_DESKTOP &&
(usage == USB_USAGE_GENERIC_KEYBOARD || usage == USB_USAGE_GENERIC_MOUSE)) {
return SDL_TRUE;