feat: add tap-hold-keys action with named key list options#1990
Merged
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PRESSED_KEYS is a HashSet<OsCode> on macOS (and Windows with interception_driver), but a HashMap<OsCode, Instant> on Windows without interception_driver. Iterating the HashMap yields tuples, so .0 is needed there, but iterating the HashSet yields OsCode directly, making .0 a compile error on macOS. Use cfg-conditional release_key calls matching the PRESSED_KEYS type definitions, consistent with the pattern used elsewhere (e.g. sim_tests/mod.rs). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds a new tap-hold variant `tap-hold-keys` that uses named optional list parameters instead of positional key lists. This addresses the usability concern of `tap-hold-release-tap-keys-release` having too many positional parameters, and adds the ability to trigger hold early on press for specific keys (closes jtroo#1985). Syntax: (tap-hold-keys <repress-timeout> <hold-timeout> <tap> <hold> (tap-on-press <keys...>) (tap-on-press-release <keys...>) (hold-on-press <keys...>)) All list options are optional. Unlisted keys use PermissiveHold behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
631c6e5 to
1099174
Compare
jtroo
requested changes
Mar 23, 2026
|
|
||
| /// Parse keys from a named option list like `(tap-on-press a b c)`. | ||
| /// The first element is the keyword, remaining elements are key names. | ||
| fn parse_key_list_from_option( |
Owner
There was a problem hiding this comment.
I would prefer this check for duplicates keys from the other options and trigger an error on duplicates.
- Remove .github/workflows/claude-code-review.yml - Reject duplicate keys across tap-hold-keys option lists - Update priority_order test to verify duplicate key error Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
# Conflicts: # src/tests/sim_tests/tap_hold_tests.rs
jtroo
approved these changes
Mar 24, 2026
malpern
added a commit
to malpern/kanata
that referenced
this pull request
May 15, 2026
Add `tap-hold-keys` action with named optional list parameters. Closes jtroo#1985. Follows the design from jtroo#1985 (comment): named list params instead of more positional args. ``` (tap-hold-keys 200 200 a lctl (tap-on-press z v) (tap-on-press-release b c) (hold-on-press 1 2 3)) ``` All three lists are optional. Unlisted keys use PermissiveHold behavior. No unicode alias added — happy to add one if you have a preferred name. --- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.
Describe your changes. Use imperative present tense.
Add
tap-hold-keysaction with named optional list parameters.Closes #1985. Follows the design from #1985 (comment):
named list params instead of more positional args.
All three lists are optional. Unlisted keys use PermissiveHold behavior.
No unicode alias added — happy to add one if you have a preferred name.
Checklist