1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! macOS Input Monitoring (TCC) status for the HID++ transport.
//!
//! `openlogi-hid` opens Logitech HID nodes through `IOHIDManager` (via
//! `async-hid`), which macOS gates behind the Input Monitoring privacy
//! permission — without it, every `IOHIDDeviceOpen` is silently denied and no
//! HID++ device ever appears, with no error surfaced beyond a debug log.
//!
//! Checking never prompts; [`request_access`] is the prompting call, and it
//! must run in this process (the agent), not the GUI — a TCC grant is scoped
//! to the code-signing identity that asks for it, and the agent (not the GUI)
//! is the one that actually opens HID devices.
use cfg_select;
/// Whether this process currently holds Input Monitoring access.
///
/// Always `true` off macOS, where HID access has no privacy gate.
/// Raise the macOS Input Monitoring consent dialog if not yet determined, so
/// this process (and not whichever process last called it) is the one listed
/// under System Settings → Privacy & Security → Input Monitoring.
///
/// Blocks the calling thread until the user responds — run it off the async
/// runtime (e.g. `tokio::task::spawn_blocking`). No-op off macOS.