[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 16:52:22 +01:00
committed by GitHub
co-authored by Stefan Kerkmann
parent 8698d109d7
commit cbabc8dbe6
226 changed files with 462 additions and 380 deletions
+2 -2
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"},
+7 -6
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.
+16 -15
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`:
+1 -1
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 */
+1 -1
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 */
@@ -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
@@ -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)
@@ -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
@@ -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;
}
}
+1 -1
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
+1 -1
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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.
@@ -41,7 +41,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.
@@ -37,7 +37,7 @@
* Enable rapid switch from tap to hold. Disable auto-repeat when pressing key
* twice, except for one-shot keys.
*/
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0
/*
* Tap-or-Hold decision modes.
@@ -32,7 +32,7 @@
// #define IGNORE_MOD_TAP_INTERRUPT
// Enable rapid switch from tap to hold, disables double tap hold auto-repeat.
// #define TAPPING_FORCE_HOLD
// #define QUICK_TAP_TERM 0
// Apply the modifier on keys that are tapped during a short hold of a modtap
// #define PERMISSIVE_HOLD
@@ -25,7 +25,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 300
#define PERMISSIVE_HOLD
#define IGNORE_MOD_TAP_INTERRUPT
@@ -25,7 +25,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 300
#define PERMISSIVE_HOLD
#define IGNORE_MOD_TAP_INTERRUPT
+1 -1
View File
@@ -10,7 +10,7 @@
#define IGNORE_MOD_TAP_INTERRUPT
// Enable rapid switch from tap to hold, disables double tap hold auto-repeat.
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0
// Apply the modifier on keys that are tapped during a short hold of a modtap
#define PERMISSIVE_HOLD
+1 -1
View File
@@ -10,7 +10,7 @@
#define IGNORE_MOD_TAP_INTERRUPT
// Enable rapid switch from tap to hold, disables double tap hold auto-repeat.
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0
// Apply the modifier on keys that are tapped during a short hold of a modtap
#define PERMISSIVE_HOLD
@@ -26,7 +26,7 @@
#undef TAPPING_TERM
#define IGNORE_MOD_TAP_INTERRUPT
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0
#define TAPPING_TERM 150
#endif
+1 -1
View File
@@ -27,7 +27,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 100
#ifdef RGBLIGHT_ENABLE
+1 -1
View File
@@ -10,7 +10,7 @@
#define EE_HANDS
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0
#ifdef RGBLIGHT_ENABLE
#undef RGBLED_NUM
+1 -1
View File
@@ -31,7 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// #define EE_HANDS
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0
#define TAPPING_TERM 200
#define PERMISSIVE_HOLD
#define IGNORE_MOD_TAP_INTERRUPT
+1 -1
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 PERMISSIVE_HOLD
#define TAPPING_TERM 300
#define IGNORE_MOD_TAP_INTERRUPT
+1 -1
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 175
#define PERMISSIVE_HOLD
#define IGNORE_MOD_TAP_INTERRUPT
+1 -1
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 150
// #define RETRO_TAPPING
// #define IGNORE_MOD_TAP_INTERRUPT
+1 -1
View File
@@ -25,7 +25,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 100
#ifdef RGBLIGHT_ENABLE
+1 -1
View File
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0
#define TAPPING_TERM 200
#ifdef RGB_MATRIX_ENABLE
+1 -1
View File
@@ -26,7 +26,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 200
// #define RETRO_TAPPING
// #define IGNORE_MOD_TAP_INTERRUPT
+1 -1
View File
@@ -32,7 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#undef USE_I2C
#undef SSD1306OLED
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0
#define TAPPING_TERM 200
// #define RETRO_TAPPING
// #define IGNORE_MOD_TAP_INTERRUPT
+1 -1
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 100
#ifdef RGBLIGHT_ENABLE
+1 -1
View File
@@ -34,7 +34,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define CUSTOM_LAYER_READ //if you remove this it causes issues - needs better guarding
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0
#define TAPPING_TERM 200
#define RGBLIGHT_SLEEP
+1 -1
View File
@@ -8,7 +8,7 @@
#define SWAP_SCLN
// #define TAPPING_FORCE_HOLD
// #define QUICK_TAP_TERM 0
#define TAPPING_TERM 300
#define IGNORE_MOD_TAP_INTERRUPT
+1 -1
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 100
#define TAPPING_TERM 150
+1 -1
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 100
#undef RGBLED_NUM
@@ -29,6 +29,6 @@
#define IGNORE_MOD_TAP_INTERRUPT
// Enable rapid switch from tap to hold, disables double tap hold auto-repeat.
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0
//#define OLED_FONT_H "keyboards/crkbd/lib/glcdfont.c"
+1 -1
View File
@@ -29,7 +29,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 150
#undef PRODUCT
#define PRODUCT "CRKBD Loose Transistor Ed."
+1 -1
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 100
#ifdef RGBLIGHT_ENABLE
@@ -19,7 +19,7 @@
#define EXTRA_SHORT_COMBOS
//Tapping values
//#define TAPPING_FORCE_HOLD
//#define QUICK_TAP_TERM 0
#define TAPPING_TERM 200
#define IGNORE_MOD_TAP_INTERRUPT
#define PERMISSIVE_HOLD_PER_KEY
+1 -1
View File
@@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MASTER_LEFT
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0
#ifdef RGB_MATRIX_ENABLE
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 120
+1 -1
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 100
#undef RGBLED_NUM
+1 -1
View File
@@ -18,7 +18,7 @@
#define EE_HANDS
#define TAPPING_FORCE_HOLD
#define QUICK_TAP_TERM 0
#define TAPPING_TERM 100
#define NO_ACTION_ONESHOT

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