Added support for wired XBox controllers on macOS 15.0 Sequoia

Fixes https://github.com/libsdl-org/SDL/issues/11002
This commit is contained in:
Sam Lantinga
2024-10-07 15:42:55 -07:00
parent 659f2f4b04
commit 7da728a642
4 changed files with 18 additions and 49 deletions

View File

@@ -475,6 +475,11 @@ static bool GetDeviceInfo(IOHIDDeviceRef hidDevice, recDevice *pDevice)
CFNumberGetValue(refCF, kCFNumberSInt32Type, &version);
}
if (SDL_IsJoystickXboxOne(vendor, product)) {
// We can't actually use this API for Xbox controllers
return false;
}
// get device name
refCF = IOHIDDeviceGetProperty(hidDevice, CFSTR(kIOHIDManufacturerKey));
if ((!refCF) || (!CFStringGetCString(refCF, manufacturer_string, sizeof(manufacturer_string), kCFStringEncodingUTF8))) {