SDL: Fixed detecting Bluetooth Steam Controllers on Windows

From d032492aaba19c108dfd5e52866573bd02bf6148 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 5 Jun 2023 21:28:12 -0700
Subject: [PATCH] Fixed detecting Bluetooth Steam Controllers on Windows

---
 src/hidapi/SDL_hidapi.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/hidapi/SDL_hidapi.c b/src/hidapi/SDL_hidapi.c
index 6d780cd9510f..5be9ff3a7db3 100644
--- a/src/hidapi/SDL_hidapi.c
+++ b/src/hidapi/SDL_hidapi.c
@@ -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;