HIDMON
Simple library for monitoring HID (keyboard, mouse) events.
Supported Targets
- Windows
- Tested as working on Windows 11 Build 22631
Example Usage
See src/main.rs
Limitations
-
Windows
- You MUST have a message loop running on the same thread as the
HidMonitorhooks enabled by this function, otherwise your system may become unresponsive! For maximum safety, ensure the message loop is running before enabling any hooks, or shortly after. For applications which otherwise do not care about handlingWinApimessages, [HidMonitor::message_loop] serves as a convenience function for starting a simple message handler. - Only one unique
HidTypecan be monitored per running process. For example, attempting to start multipleHidMonitor's withHidType::Mousewill result in an error. - Read more about the implications of this function on the
WinApidocumentation forSetWindowsHookExA
- You MUST have a message loop running on the same thread as the
-
Unix
- TODO
TODO
- Unix support
- Unit testing
- Support for multiple callbacks for a given HID type
- Support for user data in callbacks
License
This project is licensed under the Apache License 2.0.
See the LICENSE file for details.