Merge pull request #619 from gtalusan/master
Mac: fix gamepad control on Catalina
This commit is contained in:
commit
04692e1ee4
@ -700,14 +700,15 @@ std::unordered_map<struct JoypadInput, S9xButtonCode> GetJuypadButtons(uint32 ve
|
||||
void SetUpHID (void)
|
||||
{
|
||||
hidManager = IOHIDManagerCreate(kCFAllocatorDefault, kIOHIDOptionsTypeNone);
|
||||
IOHIDManagerRegisterInputValueCallback(hidManager, gamepadAction, NULL);
|
||||
IOHIDManagerScheduleWithRunLoop(hidManager, CFRunLoopGetMain(), kCFRunLoopDefaultMode);
|
||||
IOHIDManagerSetDeviceMatching(hidManager, NULL);
|
||||
|
||||
ParseDefaults();
|
||||
|
||||
if (hidManager != NULL && IOHIDManagerOpen(hidManager, kIOHIDOptionsTypeNone) == kIOReturnSuccess)
|
||||
{
|
||||
IOHIDManagerRegisterInputValueCallback(hidManager, gamepadAction, NULL);
|
||||
IOHIDManagerScheduleWithRunLoop(hidManager, CFRunLoopGetMain(), kCFRunLoopDefaultMode);
|
||||
IOHIDManagerSetDeviceMatching(hidManager, NULL);
|
||||
|
||||
ParseDefaults();
|
||||
|
||||
NSSet* devices = (NSSet *)CFBridgingRelease(IOHIDManagerCopyDevices(hidManager));
|
||||
NSMutableArray *orderedDevices = [devices.allObjects mutableCopy];
|
||||
|
||||
@ -763,6 +764,7 @@ void SetUpHID (void)
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Unable to open IOHIDManager\n");
|
||||
hidManager = NULL;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user