[Core] Chordal Hold, an "opposite hands rule" tap-hold option similar to Achordion, Bilateral Combinations, and adapted for Vial. #90
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.
This PR adds a "Chordal Hold" tap-hold option as a core QMK feature plus Vial integrations.
Overview
Chordal Hold implements an "opposite hands rule," similar to my Achordion library and Bilateral Combinations. This is useful especially with home row mods to prevent accidental mod triggers in rolled key presses. However unlike Achordion and Bilateral Combinations, the Chordal Hold implementation is made directly within QMK's core action_tapping code. From a user's perspective, the benefits of this are that Chordal Hold has lower lag and better robustness than these previous solutions.
This PR parallels qmk/qmk_firmware#24560, where I aim to add Chordal Hold to the upstream QMK repo. A minor difference here, for use with Vial, is that I added a boolean so that Chordal Hold may be enabled/disabled dynamically.
Description
Suppose tap-hold key is pressed and then, before the tapping term, another key is pressed. With Chordal Hold, the tap-hold key is settled as tapped if the two keys are on the same hand. This behavior may be useful to avoid accidental modifier activation with mod-taps, particularly in rolled keypresses when using home row mods.
In the case that the keys are on opposite hands, Chordal Hold alone does not yet settle the tap-hold key. Chordal Hold may be used in combination with Hold On Other Key Press or Permissive Hold to determine the behavior. With Hold On Other Key Press, an opposite hands chord is settled immediately as held. Or with Permissive Hold, an opposite hands chord is settled as held provided the other key is pressed and released (nested press) before releasing the tap-hold key.
Further notes:
Chordal Hold has no effect after the tapping term.
Chordal Hold has no effect when combos are involved.
Svalboard's thumb keys are exempt from the opposite hands rule. Same-hand chords are allowed with thumb keys.
How to use Chordal Hold
Chordal Hold is turned off by default. To enable it:
SV_TOGGLE_CHORDAL_HOLD
). Tap the key once to enable Chordal Hold.Chordal Hold: yes, Achordion: no
."These settings are saved persistently to EEPROM, so the above only needs to be done once.
Optionally, I recommend also configuring the tap-hold settings like this, under QMK Settings → Tap-Hold:
Implementation outline
This is a large PR, so here is an outline to help navigate:
quantum/action_tapping.{c,h}
: core Chordal Hold implementation.docs/tap_hold.md
: documents how Chordal Hold works.lib/python/qmk/cli/generate/keyboard_c.py
: generates a "chordal_hold_layout
" array to mark the handedness of each key. This is created at build time, in Python, from keyboard.json.tests/tap_hold_configurations/chordal_hold
: unit tests.keyboards/svalboard/keymaps/keymap_support.{c,h}
: keycodeSV_TOGGLE_CHORDAL_HOLD
to toggle Chordal Hold.keyboards/svalboard/keymaps/vial/vial.json
: Vial definition ofSV_TOGGLE_CHORDAL_HOLD
.keyboards/svalboard/svalboard.{c,h}
: persistent setting for whether Chordal Hold is enabled.