#hid #mouse #keyboard #windows

bin+lib hidmon

Lightweight, callback-based keyboard/mouse monitoring

3 unstable releases

0.2.0 Feb 16, 2025
0.1.1 Feb 10, 2025
0.1.0 Feb 9, 2025

#1397 in Hardware support

Download history 195/week @ 2025-02-05 158/week @ 2025-02-12 14/week @ 2025-02-19 9/week @ 2025-02-26

376 downloads per month

Apache-2.0

17KB
308 lines

License: Apache 2.0

HIDMON

Simple library for monitoring HID (keyboard, mouse) events via callbacks.

Supported Targets

  • Windows
    • Tested as working on Windows 11 Build 22631

Example Usage

See src/main.rs

Limitations/Warnings

  • Windows

    • You MUST have a message loop running on the same thread as any HidMonitor before calling HidMonitor::enable, 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 handling WinApi messages, HidMonitor::message_loop serves as a convenience function for starting a simple message handler.
    • Read more about the implications of HidMonitor::enable on the WinApi documentation for SetWindowsHookExA
  • Unix

    • TODO

TODO

  • Unix support
  • Unit testing
  • Handle panics that occur inside inside user-defined callbacks (and documentation on this behavior)

License

This project is licensed under the Apache License 2.0.
See the LICENSE file for details.

Dependencies

~123MB
~2M SLoC