qmk-hid 0.1.0

A simple CLI for bidirectional communication with QMK keyboards using raw HID.
Documentation
  • Coverage
  • 29.41%
    5 out of 17 items documented0 out of 5 items with examples
  • Size
  • Source code size: 20.29 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 462.86 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 20s Average build duration of successful builds.
  • all releases: 20s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • luckasRanarison/qmk-hid
    8 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • luckasRanarison

qmk-hid

A simple CLI for bidirectional communication with QMK keyboards using raw HID, written in Rust with a small memory footprint.

Installation

You can install qmk-hid using Cargo or by building it from source.

cargo install qmk-hid

Usage

To use qmk-hid you must find you keyboard's vendor ID and product ID. They can be usually found in your keyboard's info.json or using tools like lsusb.

On Linux, you have to setup udev rules to allow access to the HID device.

qmk-hid --help ## prints help
qmk-hid --vendor-id 18003 --product-id 4 ## example using a corve v4 keyboard

Once qmk-hid is running:

  • Incoming HID messages from the keyboard will be printed to standard output.
  • Messages can be sent to the keyboard by writing to standard input.
  • Errors and connection issues are reported to standard error output.
  • If the keyboard is not connected, qmk-hid will continuously poll for a connection until the device is available (the default interval is 3000ms).

[!IMPORTANT] In both directions the message length should be 32 bytes or less, you have to implement a custom protocol overwise

Since qmk-hid uses standard input and output for communication, it can be easily integrated into scripts or other programs. You can checkout the NodeJS demo for a simple example.

Build

To build qmk-hid you will need the Rust toolchain and libhidapi system libraries. Then you can just clone the repository and use the following command:

cargo build --release