mirror of https://github.com/snes9xgit/snes9x.git
Mac: fix gamepad control on Catalina
This commit is contained in:
parent
89f480207d
commit
c4baea0acd
|
@ -700,14 +700,15 @@ std::unordered_map<struct JoypadInput, S9xButtonCode> GetJuypadButtons(uint32 ve
|
||||||
void SetUpHID (void)
|
void SetUpHID (void)
|
||||||
{
|
{
|
||||||
hidManager = IOHIDManagerCreate(kCFAllocatorDefault, kIOHIDOptionsTypeNone);
|
hidManager = IOHIDManagerCreate(kCFAllocatorDefault, kIOHIDOptionsTypeNone);
|
||||||
IOHIDManagerRegisterInputValueCallback(hidManager, gamepadAction, NULL);
|
|
||||||
IOHIDManagerScheduleWithRunLoop(hidManager, CFRunLoopGetMain(), kCFRunLoopDefaultMode);
|
|
||||||
IOHIDManagerSetDeviceMatching(hidManager, NULL);
|
|
||||||
|
|
||||||
ParseDefaults();
|
|
||||||
|
|
||||||
if (hidManager != NULL && IOHIDManagerOpen(hidManager, kIOHIDOptionsTypeNone) == kIOReturnSuccess)
|
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));
|
NSSet* devices = (NSSet *)CFBridgingRelease(IOHIDManagerCopyDevices(hidManager));
|
||||||
NSMutableArray *orderedDevices = [devices.allObjects mutableCopy];
|
NSMutableArray *orderedDevices = [devices.allObjects mutableCopy];
|
||||||
|
|
||||||
|
@ -763,6 +764,7 @@ void SetUpHID (void)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
printf("Unable to open IOHIDManager\n");
|
||||||
hidManager = NULL;
|
hidManager = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue