fix: tap-hold-opposite-hand-release skips same-hand keys when held#2017
Merged
jtroo merged 1 commit intojtroo:mainfrom Apr 11, 2026
Merged
Conversation
The -release variant required every key to have both press+release in the queue before considering it. This caused same-hand keys that were still held (no release yet) to be skipped entirely. A subsequent opposite-hand key with its release in the queue would then incorrectly trigger Hold. Example: f(ctrl) and d(shift) on left hand, j on right hand. Pressing f↓ d↓ j↓ j↑ would resolve f as Hold(ctrl) because: 1. d↓ checked for d↑ → not found → skipped 2. j↓ checked for j↑ → found → opposite hand → Hold Fix: apply the release requirement only to opposite-hand, neutral, and unknown-hand keys. Same-hand keys resolve immediately on press, matching the non-release variant (tap-hold-opposite-hand) behavior for same-hand decisions.
Contributor
Author
|
This actually works quite well for me, if you would be tempted to close the issue, please let me know what's missing and I can try to add it 🙇 |
jtroo
approved these changes
Apr 11, 2026
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.
👋 hello, when I used the
tap-hold-opposite-hand-releaseand pressedf+dfor ctrl and shift modifiers and then pressedj, it outputted ctrl+d and ignored thef. Below is an AI-generated fix with tests. Feel free to close the issue since I didn't put too much effort into reviewing. But the fix works on my machineProblem
tap-hold-opposite-hand-releasewith(same-hand tap)incorrectly resolves as Hold when two same-hand HRM keys are pressed together followed by an opposite-hand key.Reproduction: Given left-hand HRM keys
f→ctrl andd→shift, and right-hand keyj:Expected:
fresolves as Tap (same-handdwas pressed)Actual:
fresolves as Hold(ctrl), outputting ctrl+dRoot cause
The
-releasevariant checks for both press+release in the queue before checking which hand a key belongs to:When
fis waiting and the queue contains[d↓, j↓, j↑]:d↓— looks ford↑— not found (d still held) →continue(skipped)j↓— looks forj↑— found → opposite hand → HoldThe same-hand key
dis invisible because it hasn't been released yet.Fix
Move the release check after the hand check. Only opposite-hand, neutral, and unknown-hand keys require press+release. Same-hand keys resolve immediately on press — matching
tap-hold-opposite-hand(non-release variant) behavior for same-hand decisions.This is correct because the
-releaserequirement exists to prevent misfires on fast cross-hand overlaps (e.g.,f↓ j↓ f↑ j↑should befj, notctrl+j). Same-hand keys don't need this protection — they already resolve as Tap structurally.Checklist