feat(tcp): add ChordResolved and TapDanceResolved server events - #17
Merged
Conversation
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Adds a new repeat engine that lets kanata generate key repeats instead of relying on the OS. This solves the macOS duplicate key bug where tap-hold processing delays cause unintended OS autorepeat through the HID report model. - defcfg options: managed-repeat, managed-repeat-delay, managed-repeat-interval - defrepeat block for per-key delay/interval overrides - Automatically suppresses OS hardware repeat when enabled - Modifiers are exempt from repeat - Validated on real macOS hardware through Karabiner DriverKit virtual HID - 9 simulation tests covering basic repeat, per-key overrides, modifiers, layer-while-held, and disabled-by-default behavior Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The previous approach re-posted the same HID report, which left macOS free to run its own repeat timer alongside kanata's managed repeat. Now the repeat timer has three phases: 1. HeldBeforeRelease (5ms) — key in report just long enough for initial char 2. ReleasedWaiting — key removed from report, OS repeat can never fire 3. Repeating — release+re-press cycles produce fresh keydown events Validated on macOS hardware under CPU load (KeyPath compile loop). Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The reload path was missing the managed_repeat_state and allow_hardware_repeat updates, so TCP Reload didn't pick up changes to defrepeat or managed-repeat-delay/interval. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Broadcast chord and tap-dance resolution over TCP for KeyPath's Keystroke History feature. Follows the existing HoldActivated/ TapActivated pattern with a new chord_tap_dance_tracker module. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
malpern
force-pushed
the
worktree-chord-tap-dance-tcp
branch
from
May 22, 2026 02:52
db23718 to
a5128a0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ChordResolvedandTapDanceResolvedTCP server message variants for KeyPath's Keystroke History featurechord_tap_dance_trackerkeyberon module following the existingtap_hold_trackerpattern (feature-gated, zero-sized no-op when disabled)chord-resolvedandtap-dance-resolvedcapabilities inHelloOkhandle_keystate_changesafterlayout.tick(), with key names, action descriptions, and monotonic timestampsJSON format
{"ChordResolved":{"keys":"s+d","action":"escape","t":12345}} {"TapDanceResolved":{"key":"q","tap_count":2,"action":"lalt+tab","t":12345}}Test plan
cargo build --release --target aarch64-apple-darwinsucceedscargo test -p kanata-tcp-protocol— 13 tests pass (2 new)cargo test -p kanata-keyberon— 88 tests pass, existing chord/tap-dance tests unaffected