Expand description
OS-level mouse-event hook for OpenLogi.
| Platform | Implementation |
|---|---|
| macOS | CGEventTap (same primitive used by Logi Options+) |
| Linux | evdev grab + uinput re-injection |
| Windows | WH_MOUSE_LL low-level mouse hook |
§Usage
use openlogi_hook::{Hook, MouseEvent, EventDisposition};
if !Hook::has_accessibility() {
eprintln!("grant Accessibility access first");
return;
}
let hook = Hook::start(|event| {
println!("{event:?}");
EventDisposition::PassThrough
}).unwrap();
// … later, on shutdown:
hook.stop();Structs§
- Event
Device - Best-effort identity for the physical device that produced an OS event.
- Event
TapInfo - A live event tap installed somewhere in the system, as reported by
Hook::list_event_taps. Read-only diagnostic snapshot — enumerating taps needs no Accessibility grant and any process in the session sees them all. - Hook
- A running OS-level mouse hook. Call
Hook::stopto tear down.
Enums§
- Button
Id - One of the user-rebindable hotspots on a Logi mouse. The order matches the
physical layout from front to side;
ButtonId::ALLis consumed by the default-binding generator and the popover trigger list. - Event
Disposition - What the hook callback wants the OS to do with the captured event.
- Hook
Error - Errors that
Hook::startand related functions can produce. - Mouse
Event - An event captured at the OS layer.
- TapLocation
- Where in the event stream a tap is inserted (macOS
CGEventTapLocation).
Functions§
- frontmost_
bundle_ id - Return an opaque string identifying the currently frontmost application.