Is there a way to control key behavior through Rust? #974
|
Basically, is there/will there be something similar to QMK's Additionally, for combos (and possibly other things), are there/will there be hook functions that let us customize things like re-presses and releases? Something like Thanks! |
Replies: 1 comment 1 reply
|
There is no direct equivalent of QMK's process_record_user() in the current RMK configuration language. RMK does expose raw matrix press/release events as KeyboardEvent, and the documented processor API lets Rust code subscribe to events: https://github.com/HaoboGu/rmk/blob/main/rmk/src/event/input.rs A custom processor can therefore observe row/column positions and pressed state, but it is not a synchronous replacement hook that can rewrite the key action before the keyboard keymap handles it. For normal customization, use the built-in behavior that matches the state machine you need:
The current combo configuration has actions, output, layer, timeout, and prior-idle handling, but it does not expose QMK's process_combo_key_repress hook. A bidirectional Alt+Tab behavior that depends on the exact re-press/release history would therefore need either a custom core behavior or an upstream extension, not just a TOML mapping. If you implement it in Rust, subscribe to KeyboardEvent for observation and keep the actual output/state machine in a custom behavior integrated at the keyboard processing stage. A processor that only listens to the event channel may see events after the keymap has already made its decision. |
There is no direct equivalent of QMK's process_record_user() in the current RMK configuration language.
RMK does expose raw matrix press/release events as KeyboardEvent, and the documented processor API lets Rust code subscribe to events:
https://github.com/HaoboGu/rmk/blob/main/rmk/src/event/input.rs
https://github.com/HaoboGu/rmk/blob/main/rmk/src/processor/mod.rs
https://github.com/HaoboGu/rmk/blob/main/docs/docs/main/docs/features/processor.md
A custom processor can therefore observe row/column positions and pressed state, but it is not a synchronous replacement hook that can rewrite the key action before the keyboard keymap handles it. For normal customization, use the built-in behav…