Host component for communicating with QMK keyboards using Raw HID feature.
Requires support on keyboard side, currently is supported by stront.
Application is written in Rust which gives easy access to HID libraries, low-level Windows/Linux APIs and cross-platform compatibility.
Windows | Linux | MacOS | |
---|---|---|---|
Time | ✔️ | ✔️ | ✔️ |
Volume | ✔️ | ✔️ (PulseAudio) | ✔️ |
Input layout | ✔️ | ✔️ (X11) | ✔️ |
Media info | ✔️ | ✔️ (D-Bus) |
MacOS is partially supported, as I don't own any Apple devices, feel free to raise PRs.
All files are available in latest release.
Default configuration is set to stront. For other keyboards you need to modify the configuration file (qmk-hid-host.json
).
devices
section contains a list of keyboardsproductId
-pid
from your keyboard'sinfo.json
name
- keyboard's name (optional, visible only in logs)usage
andusagePage
- optional, override only ifRAW_USAGE_ID
andRAW_USAGE_PAGE
were redefined in firmware
layouts
- list of supported keyboard layouts in two-letter format (app sends layout's index, not name)reconnectDelay
- delay between reconnecting attempts in milliseconds (optional, default is 5000)
{
"devices": [
{
"productId": "0x0844"
}
],
"layouts": ["en"]
}
Configuration is read from file qmk-hid-host.json
in the current working directory. If it is not found, then the default configuration is written to this file.
You can specify a different location for the configuration file by using --config (-c)
command line option. For example:
qmk-hid-host -c $HOME/.config/qmk-hid-host/config.json
- Start
qmk-hid-host.exe
- If needed, edit config and restart the app
When you verified that the application works with your keyboard, you can use qmk-hid-host.silent.exe
instead (like add it to Startup). It does not have a console or logs, and can be killed only from Task Manager.
-
Update
udev
rules by running script (remember to updateidVendor
andidProduct
to your values first):sudo sh -c 'echo "KERNEL==\"hidraw*\", SUBSYSTEM==\"hidraw\", ATTRS{idVendor}==\"feed\", ATTRS{idProduct}==\"0844\", MODE=\"0666\"" > /etc/udev/rules.d/99-qmkhidhost.rules'
-
Reconnect keyboard
-
Start
qmk-hid-host
, add it to autorun if needed
-
Download
qmk-hid-host
-
Modify
qmk-hid-host.json
-
Add your layouts, for example:
"layouts": ["ABC", "Russian"],
if you don't know what layout are installed in you system, run qmk-hid-host with the layouts listed above, change lang and look at terminal output:
INFO qmk_hid_host::providers::layout::macos: new layout: 'ABC', layout list: ["ABC", "Russian"] INFO qmk_hid_host::providers::layout::macos: new layout: 'Russian', layout list: ["ABC", "Russian"]
"new layout:" is what you need
-
start
qmk-hid-host
from directory where yourqmk-hid-host.json
is located -
If you
qmk-hid-host
stuck atWaiting for keyboard...
there are two common mistakes:- You're wrong with productId in your config
- Close Vial app and try again
- Install Rust
- Run
cargo run
- If needed, edit
qmk-hid-host.json
in root folder and run again
- 2024-10-03 - add support for multiple devices, restructure config
- 2024-09-15 - add MacOS support
- 2024-02-06 - add Linux support
- 2024-01-21 - remove run as windows service, add silent version instead
- 2024-01-02 - support RUST_LOG, run as windows service
- 2023-07-30 - rewritten to Rust