Fix/macos hid open nonexclusive

This commit is contained in:
Ken Sanislo
2026-08-18 19:01:53 -05:00
committed by Adam Honse
parent 671f0a66f5
commit 140aa96aff
+13
View File
@@ -24,6 +24,10 @@
#include <unistd.h>
#endif
#ifdef __APPLE__
#include <hidapi_darwin.h>
#endif
using namespace std::chrono_literals;
/*---------------------------------------------------------*\
@@ -1353,6 +1357,15 @@ void DetectionManager::BackgroundHIDInit()
LOG_DEBUG("[%s] Initializing HID interfaces: %s", DETECTIONMANAGER, ((hid_status == 0) ? "Success" : "Failed"));
#ifdef __APPLE__
/*-----------------------------------------------------*\
| hidapi defaults macOS opens to exclusive (seize) |
| mode: privileged, and a second open of a held device |
| fails. Shared matches Linux and Windows. |
\*-----------------------------------------------------*/
hid_darwin_set_open_exclusive(0);
#endif
#ifdef __linux__
#ifdef __GLIBC__
/*-----------------------------------------------------*\