feat: add combo.prior_idle_time cooldown window#834
Conversation
4319f4b to
976f4fc
Compare
Size Report
|
Added a configurable cooldown window to prevent accidental combo triggers during fast typing (rollover). When configured, combo recording is skipped for the specified duration after any key press. Keys during the cooldown window still dispatch normally. Equivalent to ZMK's `require-prior-idle-ms` combo behavior. Changes: - rmk-config: add require_prior_idle_ms to TOML CombosConfig - rmk-config: add field to resolved behavior struct - rmk-macro: codegen for require_prior_idle_ms field - rmk: add require_prior_idle_ms to CombosConfig struct - rmk: add combo_require_prior_idle accessor in keymap - rmk: skip combo recording during idle cooldown window - rmk: update all test CombosConfig constructions
c79f6ae to
b69d978
Compare
|
Did you try If |
Align naming with the existing morse prior_idle_time convention. The toml field now accepts DurationMillis format (e.g. "130ms").
Thanks for the suggestion! I checked the existing prior_idle_time and confirmed in the code — it's only used in the morse flow tap path (keyboard.rs:648), gated by enable_flow_tap and key_action.is_morse(). It detects fast typing to resolve morse keys as tap immediately, which is the opposite direction of what combo needs (suppress combo during fast typing). I also tested it on hardware and confirmed it has no effect on combo behavior. |
|
Thanks! |
|
And it would be great if you can add some document. |
Document the optional prior_idle_time parameter for combo configuration in behavior.md and appendix.md, matching the renamed field from PR #834.
Added a configurable cooldown window (require_prior_idle_ms) that prevents combo recording when a key is pressed within the idle period after the previous key. This is equivalent to ZMK's per-combo require-prior-idle-ms, but implemented as a global setting under [behavior.combo].
Tested on nrf52840_split with require_prior_idle_ms = 150 — fast typing no longer triggers combo false-positives, and keystrokes are never swallowed.
When a key press falls within the idle window, combo update is skipped while the key still dispatches normally — fast typists won't lose keystrokes, only combo false-positives are prevented.
Configuration example:
[behavior.combo]
require_prior_idle_ms = 150 # 150ms cooldown
Default is no cooldown (backward compatible).