[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>
This commit is contained in:
Albert Y 2022-12-12 23:52:22 +08:00 • committed by GitHub
commit cbabc8dbe6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
226 changed files with 458 additions and 376 deletions

View file

@ -111,8 +111,6 @@
"SOFT_SERIAL_SPEED": {"info_key": "split.soft_serial_speed"},
"TAP_CODE_DELAY": {"info_key": "qmk.tap_keycode_delay", "value_type": "int"},
"TAP_HOLD_CAPS_DELAY": {"info_key": "qmk.tap_capslock_delay", "value_type": "int"},
"TAPPING_FORCE_HOLD": {"info_key": "tapping.force_hold", "value_type": "bool"},
"TAPPING_FORCE_HOLD_PER_KEY": {"info_key": "tapping.force_hold_per_key", "value_type": "bool"},
"TAPPING_TERM": {"info_key": "tapping.term", "value_type": "int"},
"TAPPING_TERM_PER_KEY": {"info_key": "tapping.term_per_key", "value_type": "bool"},
"TAPPING_TOGGLE": {"info_key": "tapping.toggle", "value_type": "int"},
@ -129,6 +127,8 @@
"UNUSED_PINS": {"info_key": "_invalid.unused_pins", "deprecated": true},
"RGBLIGHT_ANIMATIONS": {"info_key": "_invalid.rgblight.animations.all", "value_type": "bool", "invalid": true},
"QMK_KEYS_PER_SCAN": {"info_key": "qmk.keys_per_scan", "value_type": "int", "deprecated": true},
"TAPPING_FORCE_HOLD": {"info_key": "tapping.force_hold", "value_type": "bool", "deprecated": true},
"TAPPING_FORCE_HOLD_PER_KEY": {"info_key": "tapping.force_hold_per_key", "value_type": "bool", "deprecated": true},
// USB params, need to mark as failure when specified in config.h, rather than deprecated
"PRODUCT_ID": {"info_key": "usb.pid", "value_type": "hex", "deprecated": true, "replace_with": "`usb.pid` in info.json"},

View file

@ -171,12 +171,13 @@ If you define these options you will enable the associated feature, which may in
* See [Ignore Mod Tap Interrupt](tap_hold.md#ignore-mod-tap-interrupt) for details
* `#define IGNORE_MOD_TAP_INTERRUPT_PER_KEY`
* enables handling for per key `IGNORE_MOD_TAP_INTERRUPT` settings
* `#define TAPPING_FORCE_HOLD`
* makes it possible to use a dual role key as modifier shortly after having been tapped
* See [Tapping Force Hold](tap_hold.md#tapping-force-hold)
* Breaks any Tap Toggle functionality (`TT` or the One Shot Tap Toggle)
* `#define TAPPING_FORCE_HOLD_PER_KEY`
* enables handling for per key `TAPPING_FORCE_HOLD` settings
* `#define QUICK_TAP_TERM 100`
* tap-then-hold timing to use a dual role key to repeat keycode
* See [Quick Tap Term](tap_hold.md#quick-tap-term)
* Changes the timing of Tap Toggle functionality (`TT` or the One Shot Tap Toggle)
* Defaults to `TAPPING_TERM` if not defined
* `#define QUICK_TAP_TERM_PER_KEY`
* enables handling for per key `QUICK_TAP_TERM` settings
* `#define LEADER_TIMEOUT 300`
* how long before the leader key times out
* If you're having issues finishing the sequence before it times out, you may need to increase the timeout setting. Or you may want to enable the `LEADER_PER_KEY_TIMING` option, which resets the timeout after each key is tapped.

View file

@ -375,49 +375,50 @@ bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) {
}
```
## Tapping Force Hold
## Quick Tap Term
To enable `tapping force hold`, add the following to your `config.h`:
When 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.
`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`:
```c
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 120
```
When 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.
Example:
- `SFT_T(KC_A)` Down
- `SFT_T(KC_A)` Up
- `SFT_T(KC_A)` Down
- wait until the tapping term expires...
- `SFT_T(KC_A)` Up
- (wait until tapping term expires...)
With 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.
With 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.
With `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.
With `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.
!> `TAPPING_FORCE_HOLD` will break anything that uses tapping toggles (Such as the `TT` layer keycode, and the One Shot Tap Toggle).
!> `QUICK_TAP_TERM` timing will also impact anything that uses tapping toggles (Such as the `TT` layer keycode, and the One Shot Tap Toggle).
For more granular control of this feature, you can add the following to your `config.h`:
```c
#define TAPPING_FORCE_HOLD_PER_KEY
#define QUICK_TAP_TERM_PER_KEY
```
You can then add the following function to your keymap:
```c
bool get_tapping_force_hold(uint16_t keycode, keyrecord_t *record) {
uint16_t get_quick_tap_term(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case LT(1, KC_BSPC):
return true;
case SFT_T(KC_SPC):
return QUICK_TAP_TERM - 20;
default:
return false;
return QUICK_TAP_TERM;
}
}
```
?> If `QUICK_TAP_TERM` is set higher than `TAPPING_TERM`, it will default to `TAPPING_TERM`.
## Retro Tapping
To enable `retro tapping`, add the following to your `config.h`:

View file

@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0
#define TAPPING_TERM 100
/* Use I2C or Serial */

View file

@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0
#define TAPPING_TERM 100
/* Use I2C or Serial */

View file

@ -28,4 +28,4 @@
#define TAPPING_TERM 200
#define PERMISSIVE_HOLD
#define IGNORE_MOD_TAP_INTERRUPT
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0

View file

@ -16,7 +16,7 @@
#define IGNORE_MOD_TAP_INTERRUPT
// makes it possible to do rolling combos (zx) with keys that convert to other keys on hold, by enforcing the TAPPING_TERM for both keys.
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0
// makes it possible to use a dual role key as modifier shortly after having been tapped (see Hold after tap)
// Breaks any Tap Toggle functionality (TT or the One Shot Tap Toggle)

View file

@ -1,3 +1,3 @@
#define HOLD_ON_OTHER_KEY_PRESS_PER_KEY
#define TAPPING_FORCE_HOLD_PER_KEY
#define QUICK_TAP_TERM_PER_KEY
#define IGNORE_MOD_TAP_INTERRUPT_PER_KEY

View file

@ -114,13 +114,13 @@ bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) {
}
}
bool get_tapping_force_hold(uint16_t keycode, keyrecord_t *record) {
uint16_t get_quick_tap_term(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case LLS_ESC:
case LLS_RALT:
return true;
return 0;
default:
return false;
return QUICK_TAP_TERM;
}
}

View file

@ -28,7 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// #define MASTER_RIGHT
// #define EE_HANDS
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0
#define TAPPING_TERM 170
#undef RGBLED_NUM

View file

@ -8,6 +8,6 @@
#define DIODE_DIRECTION COL2ROW
#define IGNORE_MOD_TAP_INTERRUPT
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0
#define USB_MAX_POWER_CONSUMPTION 50

View file

@ -26,7 +26,7 @@
#define UNICODE_SELECTED_MODES UNICODE_MODE_WINCOMPOSE, UNICODE_MODE_WINDOWS, UNICODE_MODE_MACOS, UNICODE_MODE_LINUX
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0
#define TAPPING_TERM 200
#define TAPPING_TERM_PER_KEY

View file

@ -18,5 +18,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Select hand configuration */
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0
#define TAPPING_TERM 180

View file

@ -18,5 +18,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Select hand configuration */
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0
#define TAPPING_TERM 180

View file

@ -18,6 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Select hand configuration */
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0
#define TAPPING_TERM 180
//#define MASTER_RIGHT

View file

@ -18,5 +18,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Select hand configuration */
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0
#define TAPPING_TERM 180

View file

@ -18,5 +18,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Select hand configuration */
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0
#define TAPPING_TERM 180

View file

@ -18,5 +18,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Select hand configuration */
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0
#define TAPPING_TERM 180

View file

@ -18,6 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Select hand configuration */
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0
#define TAPPING_TERM 180
//#define MASTER_RIGHT

View file

@ -43,7 +43,7 @@
*
* See docs.qmk.fm/using-qmk/software-features/tap_hold#tapping-force-hold
*/
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0
/*
* Tap-or-Hold decision modes.

Some files were not shown because too many files have changed in this diff Show more