Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Chordal Hold, an "opposite hands rule" tap-hold option similar to Achordion, Bilateral Combinations, and adapted for Vial. #90

Open
wants to merge 5 commits into
base: vial
Choose a base branch
from

Conversation

getreuer
Copy link

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:

  1. Open the Vial web app.
  2. Under Keymap → User, add a "Toggle Chordal" key (keycode SV_TOGGLE_CHORDAL_HOLD). Tap the key once to enable Chordal Hold.
  3. If Achordion is enabled, disable it by adding a "Toggle ACH" key and tapping it once.
  4. To verify settings, add an "Output Status" key (also under the User tab). Open a text editor and press the key once. The output should include "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:

  • Tapping Term: 250 (or something generous on this order)
  • Permissive Hold: checked
  • Ignore Mod Tap Interrupt: checked

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}: keycode SV_TOGGLE_CHORDAL_HOLD to toggle Chordal Hold.
  • keyboards/svalboard/keymaps/vial/vial.json: Vial definition of SV_TOGGLE_CHORDAL_HOLD.
  • keyboards/svalboard/svalboard.{c,h}: persistent setting for whether Chordal Hold is enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant