Added SDL hints to filter the set of game controllers reported by SDL
This commit is contained in:
parent
5c88b8141c
commit
b044a3bba8
8 changed files with 248 additions and 42 deletions
|
@ -445,6 +445,12 @@ JoystickDeviceWasAddedCallback(void *ctx, IOReturn res, void *sender, IOHIDDevic
|
|||
return; /* not a device we care about, probably. */
|
||||
}
|
||||
|
||||
if (SDL_IsGameControllerNameAndGUID(device->product, device->guid) &&
|
||||
SDL_ShouldIgnoreGameController(device->product, device->guid)) {
|
||||
SDL_free(device);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Get notified when this device is disconnected. */
|
||||
IOHIDDeviceRegisterRemovalCallback(ioHIDDeviceObject, JoystickDeviceWasRemovedCallback, device);
|
||||
IOHIDDeviceScheduleWithRunLoop(ioHIDDeviceObject, CFRunLoopGetCurrent(), SDL_JOYSTICK_RUNLOOP_MODE);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue