summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorPascal Getreuer <50221757+getreuer@users.noreply.github.com>2025-04-14 09:46:24 -0700
committerGitHub <noreply@github.com>2025-04-14 09:46:24 -0700
commit8d8dcb089ed36e7e1a61d77e5a4b6b08c8668869 (patch)
treeb5aa66a32a42e5d1288e8a5751e94cba4ce06350 /docs
parenta7bf8e64a584c9a0930f4aa701a09a6e1de7e117 (diff)
[Core] Flow Tap tap-hold option to disable HRMs during fast typing (#25125)
aka Global Quick Tap, Require Prior Idle
Diffstat (limited to 'docs')
-rw-r--r--docs/tap_hold.md83
1 files changed, 83 insertions, 0 deletions
diff --git a/docs/tap_hold.md b/docs/tap_hold.md
index 254d5de5ec..f1af753eba 100644
--- a/docs/tap_hold.md
+++ b/docs/tap_hold.md
@@ -425,6 +425,89 @@ uint16_t get_quick_tap_term(uint16_t keycode, keyrecord_t *record) {
425If `QUICK_TAP_TERM` is set higher than `TAPPING_TERM`, it will default to `TAPPING_TERM`. 425If `QUICK_TAP_TERM` is set higher than `TAPPING_TERM`, it will default to `TAPPING_TERM`.
426::: 426:::
427 427
428## Flow Tap
429
430Flow Tap modifies mod-tap `MT` and layer-tap `LT` keys such that when pressed within a short timeout of the preceding key, the tapping behavior is triggered. This is particularly useful for home row mods to avoid accidental mod triggers. It basically disables the hold behavior during fast typing, creating a "flow of taps." This also helps to reduce the input lag of tap-hold keys during fast typing, since the tapped behavior is sent immediately.
431
432Flow Tap is enabled by defining `FLOW_TAP_TERM` in your `config.h` with the desired timeout in milliseconds. A timeout of 150&nbsp;ms is recommended as a starting point:
433
434```c
435#define FLOW_TAP_TERM 150
436```
437
438By default, Flow Tap is enabled when:
439
440* The tap-hold key is pressed within `FLOW_TAP_TERM` milliseconds of the previous key press.
441
442* The tapping keycodes of the previous key and tap-hold key are *both* among `KC_A`&ndash;`KC_Z`, `KC_COMM`, `KC_DOT`, `KC_SCLN`, `KC_SLSH` (the main alphas area of a conventional QWERTY layout) or `KC_SPC`.
443
444As an exception to the above, Flow Tap is temporarily disabled while a tap-hold key is undecided. This is to allow chording multiple mod-tap keys without having to wait out the Flow Tap term.
445
446
447### is_flow_tap_key()
448
449Optionally, define the `is_flow_tap_key()` callback to specify where Flow Tap is enabled. The callback is called for both the tap-hold key *and* the key press immediately preceding it, and if the callback returns true for both keycodes, Flow Tap is enabled.
450
451The default implementation of this callback is:
452
453```.c
454bool is_flow_tap_key(uint16_t keycode) {
455 if ((get_mods() & (MOD_MASK_CG | MOD_BIT_LALT)) != 0) {
456 return false; // Disable Flow Tap on hotkeys.
457 }
458 switch (get_tap_keycode(keycode)) {
459 case KC_SPC:
460 case KC_A ... KC_Z:
461 case KC_DOT:
462 case KC_COMM:
463 case KC_SCLN:
464 case KC_SLSH:
465 return true;
466 }
467 return false;
468}
469```
470
471Copy the above to your `keymap.c` and edit to customize. For instance, remove the `case KC_SPC` line to disable Flow Tap for the Space key.
472
473### get_flow_tap_term()
474
475Optionally, for further flexibility, define the `get_flow_tap_term()` callback. Flow Tap acts only when key events are closer together than the time returned by the callback. Return a time of 0 to disable filtering. In this way, Flow Tap may be disabled for certain tap-hold keys, or when following certain previous keys.
476
477The default implementation of this callback is
478
479```.c
480uint16_t get_flow_tap_term(uint16_t keycode, keyrecord_t* record,
481 uint16_t prev_keycode) {
482 if (is_flow_tap_key(keycode) && is_flow_tap_key(prev_keycode)) {
483 return FLOW_TAP_TERM;
484 }
485 return 0;
486}
487```
488
489In this callback, `keycode` and `record` correspond to the current tap-hold key, and `prev_keycode` is the keycode of the previous key. Return the timeout to use. Returning `0` disables Flow Tap. This callback enables setting per-key timeouts. It is also possible to enable or disable Flow Tap for certain tap-hold keys or when following certain previous keys. Example:
490
491```c
492uint16_t get_flow_tap_term(uint16_t keycode, keyrecord_t* record,
493 uint16_t prev_keycode) {
494 if (is_flow_tap_key(keycode) && is_flow_tap_key(prev_keycode)) {
495 switch (keycode) {
496 case LCTL_T(KC_F):
497 case RCTL_T(KC_H):
498 return FLOW_TAP_TERM - 25; // Short timeout on these keys.
499
500 default:
501 return FLOW_TAP_TERM; // Longer timeout otherwise.
502 }
503 }
504 return 0; // Disable Flow Tap.
505}
506```
507
508::: tip If you define both `is_flow_tap_key()` and `get_flow_tap_term()`, then the latter takes precedence.
509:::
510
428## Chordal Hold 511## Chordal Hold
429 512
430Chordal Hold is intended to be used together with either Permissive Hold or Hold 513Chordal Hold is intended to be used together with either Permissive Hold or Hold