Kaynağa Gözat

Fixed detecting the Steam virtual gamepad when HIDAPI is disabled

Sam Lantinga 1 gün önce
ebeveyn
işleme
ec0066aa0b
1 değiştirilmiş dosya ile 5 ekleme ve 0 silme
  1. 5 0
      src/joystick/apple/SDL_mfijoystick.m

+ 5 - 0
src/joystick/apple/SDL_mfijoystick.m

@@ -1772,6 +1772,11 @@ bool IOS_SupportedHIDDevice(IOHIDDeviceRef device)
         return false;
     }
 
+    if (IOHIDDeviceGetProperty(device, CFSTR(kIOHIDVirtualHIDevice)) == kCFBooleanTrue) {
+        // Steam virtual gamepads always have kIOHIDVirtualHIDevice property unlike real devices, and are also not exposed as GCController
+        return false;
+    }
+
     if (@available(macOS 11.0, *)) {
         const int MAX_ATTEMPTS = 3;
         for (int attempt = 0; attempt < MAX_ATTEMPTS; ++attempt) {