Fixed detecting the Steam virtual gamepad when HIDAPI is disabled

(cherry picked from commit ec0066aa0b)
This commit is contained in:
Sam Lantinga
2026-05-29 10:55:57 -07:00
parent 45c28b2eb9
commit bfdd7ee8b4

View File

@@ -1773,6 +1773,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) {