iohidmanager
Safe Rust bindings for Apple's IOKit HID subsystem on macOS — enumerate connected mice, keyboards, gamepads, and other HID devices.
Status: experimental. v0.1 ships device enumeration + property snapshots (vendor / product / manufacturer / usage page / serial / transport). Live input-report subscription via
IOHIDDeviceRegisterInputReportCallbacklands in v0.2.
Pure C — zero Swift bridge (like cgevents, imageio, videotoolbox).
Quick start
use *;
Pipeline composition
iohidmanager (enumerate) ──► 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>)filter -
devices()enumeration with vendor/product/usage/serial/transport -
HidUsageenum with Keyboard / Mouse / Joystick /GamePadpresets - Live input-report callbacks (
IOHIDDeviceRegisterInputReportCallback) - Element discovery (
IOHIDDeviceCopyMatchingElements+IOHIDElementGetUsage) - Synchronous report read / write (
IOHIDDeviceGetReport/SetReport) - Run-loop integration (
IOHIDManagerScheduleWithRunLoop) - Async API
License
Licensed under either of Apache-2.0 or MIT at your option.