summaryrefslogtreecommitdiff
path: root/docs/tap_hold.md
diff options
context:
space:
mode:
authorAlbert Y <76888457+filterpaper@users.noreply.github.com>2022-12-12 23:52:22 +0800
committerGitHub <noreply@github.com>2022-12-12 16:52:22 +0100
commitcbabc8dbe6a8476d3082e8bc649d330f87e7b904 (patch)
tree55e73275367047981295d046867d9f70352814c7 /docs/tap_hold.md
parent8698d109d7c2f4554e0f3c01b017738a0a47f162 (diff)
[Core] Replace Tapping Force Hold feature with Quick Tap Term (#17007)
* Replace Tapping Force Hold feature with Quick Tap Term * Replace keyboard level TAPPING_FORCE_HOLD with QUICK_TAP_TERM 0 * Deprecate force hold in info_config.json * Before and after quick tap term unit tests * Quick tap unit tests iteration * Keymap config.h correction * Remove TAPPING_FORCE_HOLD_PER_KEY macros that were missed * Add two more test cases for quick tap * Replace TAPPING_FORCE_HOLD with QUICK_TAP_TERM in configs #2 * Replace TAPPING_FORCE_HOLD_PER_KEY with QUICK_TAP_TERM_PER_KEY in configs #2 * Add function declaration for get_quick_tap_term Co-authored-by: Stefan Kerkmann <karlk90@pm.me>
Diffstat (limited to 'docs/tap_hold.md')
-rw-r--r--docs/tap_hold.md31
1 files changed, 16 insertions, 15 deletions
diff --git a/docs/tap_hold.md b/docs/tap_hold.md
index 8914b730b3..fa6c6abc14 100644
--- a/docs/tap_hold.md
+++ b/docs/tap_hold.md
@@ -375,49 +375,50 @@ bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) {
375} 375}
376``` 376```
377 377
378## Tapping Force Hold 378## Quick Tap Term
379 379
380To enable `tapping force hold`, add the following to your `config.h`: 380When the user holds a key after tapping it, the tapping function is repeated by default, rather than activating the hold function. This allows keeping the ability to auto-repeat the tapping function of a dual-role key. `QUICK_TAP_TERM` enables fine tuning of that ability. If set to `0`, it will remove the auto-repeat ability and activate the hold function instead.
381
382`QUICK_TAP_TERM` is set to `TAPPING_TERM` by default, which is the maximum allowed value for `QUICK_TAP_TERM`. To override its value (in milliseconds) add the following to your `config.h`:
381 383
382```c 384```c
383#define TAPPING_FORCE_HOLD 385#define QUICK_TAP_TERM 120
384``` 386```
385 387
386When the user holds a key after tapping it, the tapping function is repeated by default, rather than activating the hold function. This allows keeping the ability to auto-repeat the tapping function of a dual-role key. `TAPPING_FORCE_HOLD` removes that ability to let the user activate the hold function instead, in the case of holding the dual-role key after having tapped it.
387
388Example: 388Example:
389 389
390- `SFT_T(KC_A)` Down 390- `SFT_T(KC_A)` Down
391- `SFT_T(KC_A)` Up 391- `SFT_T(KC_A)` Up
392- `SFT_T(KC_A)` Down 392- `SFT_T(KC_A)` Down
393- wait until the tapping term expires... 393- (wait until tapping term expires...)
394- `SFT_T(KC_A)` Up
395 394
396With default settings, `a` will be sent on the first release, then `a` will be sent on the second press allowing the computer to trigger its auto-repeat function. 395With default settings, `a` will be sent on the first release, then `a` will be sent on the second press allowing the computer to trigger its auto repeat function until the key is released.
397 396
398With `TAPPING_FORCE_HOLD`, the second press will be interpreted as a Shift, allowing to use it as a modifier shortly after having used it as a tap. 397With `QUICK_TAP_TERM` configured, the timing between `SFT_T(KC_A)` up and `SFT_T(KC_A)` down must be within `QUICK_TAP_TERM` to trigger auto repeat. Otherwise the second press will be sent as a Shift. If `QUICK_TAP_TERM` is set to `0`, the second press will always be sent as a Shift, effectively disabling auto-repeat.
399 398
400!> `TAPPING_FORCE_HOLD` will break anything that uses tapping toggles (Such as the `TT` layer keycode, and the One Shot Tap Toggle). 399!> `QUICK_TAP_TERM` timing will also impact anything that uses tapping toggles (Such as the `TT` layer keycode, and the One Shot Tap Toggle).
401 400
402For more granular control of this feature, you can add the following to your `config.h`: 401For more granular control of this feature, you can add the following to your `config.h`:
403 402
404```c 403```c
405#define TAPPING_FORCE_HOLD_PER_KEY 404#define QUICK_TAP_TERM_PER_KEY
406``` 405```
407 406
408You can then add the following function to your keymap: 407You can then add the following function to your keymap:
409 408
410```c 409```c
411bool get_tapping_force_hold(uint16_t keycode, keyrecord_t *record) { 410uint16_t get_quick_tap_term(uint16_t keycode, keyrecord_t *record) {
412 switch (keycode) { 411 switch (keycode) {
413 case LT(1, KC_BSPC): 412 case SFT_T(KC_SPC):
414 return true; 413 return QUICK_TAP_TERM - 20;
415 default: 414 default:
416 return false; 415 return QUICK_TAP_TERM;
417 } 416 }
418} 417}
419``` 418```
420 419
420?> If `QUICK_TAP_TERM` is set higher than `TAPPING_TERM`, it will default to `TAPPING_TERM`.
421
421## Retro Tapping 422## Retro Tapping
422 423
423To enable `retro tapping`, add the following to your `config.h`: 424To enable `retro tapping`, add the following to your `config.h`: