From 74e4c3375666cfda2a64ed69eb9e808e30200149 Mon Sep 17 00:00:00 2001 From: Palana Date: Wed, 7 Oct 2015 10:57:13 +0200 Subject: [PATCH] libobs: Use IOKit error code when polling hotkeys (OSX) In case a system authentication prompt is open the actual error code (via err_get_code) is kIOReturnExclusiveAccess on OSX 10.9; I'm not 100% sure if this makes the "if (!value)" part of the code obsolete, but that code path shouldn't be triggered under most circumstances anyway Fixes https://obsproject.com/mantis/view.php?id=346 --- libobs/obs-cocoa.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libobs/obs-cocoa.c b/libobs/obs-cocoa.c index 25a328bae..a1755c32e 100644 --- a/libobs/obs-cocoa.c +++ b/libobs/obs-cocoa.c @@ -1319,7 +1319,12 @@ bool obs_hotkeys_platform_is_pressed(obs_hotkeys_platform_t *plat, IOHIDElementRef element = plat->keys[key].array[i]; IOHIDValueRef value = 0; IOHIDDeviceRef device = IOHIDElementGetDevice(element); - IOHIDDeviceGetValue(device, element, &value); + + if (IOHIDDeviceGetValue(device, element, &value) != + kIOReturnSuccess) { + i += 1; + continue; + } if (!value) { CFRelease(element);