iohidmanager
Safe Rust bindings for Apple's IOKit HID subsystem on macOS — enumerate connected mice, keyboards, gamepads, and other HID devices.
Status: actively developed. v0.5 ships the current public
IOHIDManager/IOHIDDevice/IOHIDElement/IOHIDValueC header surface in raw FFI, plus safe wrappers for multi-match dictionaries, element discovery, report I/O, value access, report-descriptor reads, and live input callbacks.
Pure C — zero Swift bridge (like cgevents, imageio, videotoolbox).
Quick start
use *;
Pipeline composition
iohidmanager (enumerate + inspect + subscribe) ──► your custom dispatch
│
├─► gamepad-mapper
├─► macropad-driver
└─► hardware-token authentication
Pairs naturally with cgevents (synthesise events triggered by HID input) and carbonhotkey (more focused: just global hotkeys).
Roadmap
-
HidManager::new()+ open -
set_device_matching(Option<HidUsage>)convenience filter -
DeviceMatch/ElementMatchbuilders + multi-match dictionaries -
devices()enumeration with vendor/product/usage/serial/transport snapshots -
live_devices()handles for per-device work - Live input-report callbacks (
on_input_report,on_input_report_with_timestamp) - Live input-value callbacks (
on_input_value) - Element discovery + metadata (
elements,matching_elements,HidElementaccessors) -
HidValuecreation + synchronous reads (get_value,get_value_with_options) - Synchronous report read / write (
get_report,set_report) - Generic property helpers + report-descriptor reads
- Dispatch-queue convenience wrappers
- Safe manager-level add/remove/value/report callback wrappers
License
Licensed under either of Apache-2.0 or MIT at your option.