feat: add tap-hold-release-order action#1970
Conversation
3fb0d84 to
6e2d884
Compare
|
Nice work — release-order disambiguation fills a real gap. A couple thoughts: NamingMy main concern is For context, the ecosystem is already a bit of a maze here:
Some alternatives that might read more distinctly:
Not sure what's best though — @jtroo you have much better sense of how users navigate the existing variant names. What do you think? ImplementationCode is clean — slots into
All minor — overall this looks like a solid addition. |
|
Thanks for the contribution! Two main things:
To expand more on naming, I believe |
6e2d884 to
5f4b8b9
Compare
…guation Adds a new HoldTapConfig variant (HoldOnOtherKeyPressWithGap) that resolves tap vs hold based on the time gap between the tap-hold keydown and the next keydown, rather than using a timeout. If the gap is below the threshold, resolves as tap (fast typing overlap). If above, resolves as hold (intentional modifier). One parameter: min-gap-ms. Config: (tap-hold-press-gap <min-gap-ms> <tap-action> <hold-action>) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pure event-driven tap-hold disambiguation with zero parameters. After both keys are down, the first release determines intent: - Other key releases first (modifier still held) → Hold - Modifier releases first (other key still held) → Tap No timers, no thresholds. Decision on the 3rd event only. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…riod Key presses within the buffer (ms) after the hold-tap key press are ignored by release-order logic, resolving as Tap regardless of release order. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Allows double-tap-and-hold to bypass hold-tap logic and repeat the tap action. Syntax is now: (tap-hold-release-order <tap-repress-timeout> <buffer-ms> <tap> <hold>) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ey test, add comments
c30e122 to
6f8643c
Compare
|
Updated per feedback:
|
jtroo
left a comment
There was a problem hiding this comment.
Please add some simulation tests to test closer to end-to-end. Also please add a test case for a press within the buffer window; I didn't spot one in the keyberon tests.
https://github.com/jtroo/kanata/blob/main/src/tests/sim_tests/tap_hold_tests.rs
Simulation tests can be run like so:
Line 35 in 07bed9e
Updated with simulation tests and keyberon buffer test per your feedback. Tests cover: clean tap, hold via release-order, tap via release-order, buffer ignoring fast typing, hold after buffer expires, require-prior-idle short-circuit, and require-prior-idle passthrough. All 184 sim tests pass |
Add tap-hold-order: event-driven tap-hold disambiguation A new `tap-hold` variant that resolves based on **release order** rather than timing: - If another key is pressed **and released** while the hold-tap key is still held → **Hold** - If the hold-tap key is released first → **Tap** This is useful for spacebar-as-modifier setups where timeout-based approaches either add latency (high timeout) or misfire during fast typing (low timeout). Release-order makes the decision purely event-driven. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Brings in upstream commits through jtroo#1977, including: - tap-hold-order action (jtroo#1970) - per-action require-prior-idle upstream merge (jtroo#1969) - macOS output readiness refactor (jtroo#1964) - layer change tick fix (jtroo#1977) Conflicts in per-action require-prior-idle code resolved by taking upstream's canonical version. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add tap-hold-release-order: event-driven tap-hold disambiguation
A new
tap-holdvariant that resolves based on release order rather than timing:This is useful for spacebar-as-modifier setups where timeout-based approaches either add latency (high timeout) or misfire during fast typing (low timeout). Release-order makes the decision purely event-driven.
Parameters
$tap-repress-timeout0to disable.$buffer-ms0to disable.Example
a, releasea(while space still held) → activates symbols layera, release space first → outputs space thenaChecklist