From 3b9e186019f74d5046fbdd399b5cfa0baf513a75 Mon Sep 17 00:00:00 2001
From: precondition <57645186+precondition@users.noreply.github.com>
Date: Fri, 24 Jun 2022 12:40:09 +0200
Subject: [PATCH] Do not enable PERMISSIVE_HOLD when TAPPING_TERM exceeds 500ms
(#15674)
---
docs/config_options.md | 2 +-
docs/ja/config_options.md | 2 +-
keyboards/1k/keymaps/tap_dance/config.h | 1 +
.../sweet16/keymaps/ridingintraffic/config.h | 3 ++-
keyboards/flehrad/bigswitch/keymaps/333fred/config.h | 1 +
keyboards/handwired/ergocheap/config.h | 1 +
keyboards/handwired/onekey/config.h | 1 +
keyboards/handwired/uthol/rev3/config.h | 1 +
keyboards/helix/pico/keymaps/mtei/config.h | 2 --
keyboards/helix/rev2/keymaps/five_rows/config.h | 2 --
.../helix/rev3_5rows/keymaps/five_rows/config.h | 2 --
keyboards/idobao/id67/keymaps/thewerther/config.h | 1 +
.../thevankeyboards/minivan/keymaps/belak/config.h | 1 +
.../thevankeyboards/minivan/keymaps/halvves/config.h | 1 +
.../bigseries/1key/keymaps/dudeofawesome/config.h | 1 +
keyboards/xiudi/xd002/keymaps/tap_dance/config.h | 1 +
keyboards/zfrontier/big_switch/config.h | 1 +
layouts/community/66_ansi/xyverz/config.h | 1 +
layouts/community/ergodox/adam/config.h | 2 +-
quantum/action_tapping.c | 12 +++++-------
users/hvp/config.h | 3 ++-
21 files changed, 24 insertions(+), 18 deletions(-)
diff --git a/docs/config_options.md b/docs/config_options.md
index 9aa360576a07a34f57a7a03633de671d30f44b35..c35227a4072e1492f2d8c8c68e94e3b91b9907ef 100644
--- a/docs/config_options.md
+++ b/docs/config_options.md
@@ -141,7 +141,7 @@ If you define these options you will enable the associated feature, which may in
## Behaviors That Can Be Configured
* `#define TAPPING_TERM 200`
- * how long before a tap becomes a hold, if set above 500, a key tapped during the tapping term will turn it into a hold too
+ * how long before a key press becomes a hold
* `#define TAPPING_TERM_PER_KEY`
* enables handling for per key `TAPPING_TERM` settings
* `#define RETRO_TAPPING`
diff --git a/docs/ja/config_options.md b/docs/ja/config_options.md
index fb43d015f20e564b0980c621a4f08655f5f49a00..42dd9d502a2f9594e2d95357808d6b4eb3876a7c 100644
--- a/docs/ja/config_options.md
+++ b/docs/ja/config_options.md
@@ -144,7 +144,7 @@ QMK での全ての利用可能な設定にはデフォルトがあります。
## 設定可能な挙動 :id=behaviors-that-can-be-configured
* `#define TAPPING_TERM 200`
- * タップがホールドになるまでの時間。500以上に設定された場合、タップ期間中にタップされたキーもホールドになります。(訳注: PERMISSIVE_HOLDも参照)
+ * タップがホールドになるまでの時間。
* `#define TAPPING_TERM_PER_KEY`
* キーごとの `TAPPING_TERM` 設定の処理を有効にします
* `#define RETRO_TAPPING`
diff --git a/keyboards/1k/keymaps/tap_dance/config.h b/keyboards/1k/keymaps/tap_dance/config.h
index 5df7869537e2fffe9d3c24c5d3b3b9d31cc7e36c..bd0163e4475c60ff18aa021615531a334b1d455a 100644
--- a/keyboards/1k/keymaps/tap_dance/config.h
+++ b/keyboards/1k/keymaps/tap_dance/config.h
@@ -4,3 +4,4 @@
#pragma once
#define TAPPING_TERM 500
+#define PERMISSIVE_HOLD
diff --git a/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/config.h b/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/config.h
index c83544007644071c5c9fba5c28c04125c313ef90..161b46c814ec98b80cc24097319921575aa2c237 100644
--- a/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/config.h
+++ b/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/config.h
@@ -3,6 +3,7 @@
/* tap dance stuff*/
#undef TAPPING_TERM
#define TAPPING_TERM 500
+#define PERMISSIVE_HOLD
#define TAPPING_TOGGLE 2
@@ -12,4 +13,4 @@
#define EXAMPLESTRING4 "tapdance_4"
#undef RGBLED_NUM
-#define RGBLED_NUM 16
\ No newline at end of file
+#define RGBLED_NUM 16
diff --git a/keyboards/flehrad/bigswitch/keymaps/333fred/config.h b/keyboards/flehrad/bigswitch/keymaps/333fred/config.h
index 3273cc8db422c51d2df0f04d80425fa719b3e1e0..6e9219115cc49197583fbf0e2948ee22b31d26f7 100644
--- a/keyboards/flehrad/bigswitch/keymaps/333fred/config.h
+++ b/keyboards/flehrad/bigswitch/keymaps/333fred/config.h
@@ -24,3 +24,4 @@
// Long tapping term on the big switch, because it takes so long to press
#define TAPPING_TERM 500
+#define PERMISSIVE_HOLD
diff --git a/keyboards/handwired/ergocheap/config.h b/keyboards/handwired/ergocheap/config.h
index 26905e8cb3800f81f73cf06b3cabdc71c15a3476..00b9616e3e2348ae4e5f32617eb669e4a28dfee2 100644
--- a/keyboards/handwired/ergocheap/config.h
+++ b/keyboards/handwired/ergocheap/config.h
@@ -47,6 +47,7 @@ along with this program. If not, see .
/* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5
#define TAPPING_TERM 500
+#define PERMISSIVE_HOLD
/*
* Feature disable options
diff --git a/keyboards/handwired/onekey/config.h b/keyboards/handwired/onekey/config.h
index f491d4d393705e06f219d982385a41b300c10b2d..88c15806cefd07bd3b94a4c9ec18aa6c8d6e3c68 100644
--- a/keyboards/handwired/onekey/config.h
+++ b/keyboards/handwired/onekey/config.h
@@ -42,6 +42,7 @@ along with this program. If not, see .
#define LOCKING_RESYNC_ENABLE
#define TAPPING_TERM 500
+#define PERMISSIVE_HOLD
/*
* Feature disable options
diff --git a/keyboards/handwired/uthol/rev3/config.h b/keyboards/handwired/uthol/rev3/config.h
index 90880998b712ea6b483b794ef81b3022005322c6..84ca3f0cc6f8235ad1f3109f9c2d1d6fbec3ce89 100644
--- a/keyboards/handwired/uthol/rev3/config.h
+++ b/keyboards/handwired/uthol/rev3/config.h
@@ -57,6 +57,7 @@
#define LOCKING_RESYNC_ENABLE
#define TAPPING_TERM 500
+#define PERMISSIVE_HOLD
// RGB Stuff
#define RGB_DI_PIN B0
diff --git a/keyboards/helix/pico/keymaps/mtei/config.h b/keyboards/helix/pico/keymaps/mtei/config.h
index 1a4dc2c8424b4d4bdac526bf29427cfe1e35a583..a633105ff976b10229296ab7f24945cf9edcf01a 100644
--- a/keyboards/helix/pico/keymaps/mtei/config.h
+++ b/keyboards/helix/pico/keymaps/mtei/config.h
@@ -13,8 +13,6 @@
#undef TAPPING_TERM
#define TAPPING_TERM 300
#define PERMISSIVE_HOLD
-/* when TAPPING_TERM >= 500 same effect PERMISSIVE_HOLD.
- see tmk_core/common/action_tapping.c */
// If you need more program area, try select and reduce rgblight modes to use.
diff --git a/keyboards/helix/rev2/keymaps/five_rows/config.h b/keyboards/helix/rev2/keymaps/five_rows/config.h
index 4aae9b5cac87443e008a6f6c5e482c231dc2d893..43f14aaf2c9ed5de89dec4bf41210af49ca766f4 100644
--- a/keyboards/helix/rev2/keymaps/five_rows/config.h
+++ b/keyboards/helix/rev2/keymaps/five_rows/config.h
@@ -6,8 +6,6 @@
#undef TAPPING_TERM
#define TAPPING_TERM 300
#define PERMISSIVE_HOLD
-/* when TAPPING_TERM >= 500 same effect PERMISSIVE_HOLD.
- see tmk_core/common/action_tapping.c */
#undef OLED_UPDATE_INTERVAL
#ifdef DEBUG_MATRIX_SCAN_RATE
diff --git a/keyboards/helix/rev3_5rows/keymaps/five_rows/config.h b/keyboards/helix/rev3_5rows/keymaps/five_rows/config.h
index ab679d14b99a9f2a5609323c74760941c9bb26c8..a6fd32c613c37c3da6e1e8c94f418e1b70be66b4 100644
--- a/keyboards/helix/rev3_5rows/keymaps/five_rows/config.h
+++ b/keyboards/helix/rev3_5rows/keymaps/five_rows/config.h
@@ -6,8 +6,6 @@
#undef TAPPING_TERM
#define TAPPING_TERM 300
#define PERMISSIVE_HOLD
-/* when TAPPING_TERM >= 500 same effect PERMISSIVE_HOLD.
- see tmk_core/common/action_tapping.c */
#undef OLED_UPDATE_INTERVAL
#ifdef DEBUG_MATRIX_SCAN_RATE
diff --git a/keyboards/idobao/id67/keymaps/thewerther/config.h b/keyboards/idobao/id67/keymaps/thewerther/config.h
index a63a92b17177ba0f3e897c41e0a4308d0c47734f..85498d91b8edab6a8565807bb88b9e59ab5a9965 100644
--- a/keyboards/idobao/id67/keymaps/thewerther/config.h
+++ b/keyboards/idobao/id67/keymaps/thewerther/config.h
@@ -18,6 +18,7 @@
#define DRIVER_LED_UNDERGLOW 10
#define TAPPING_TERM 500
+#define PERMISSIVE_HOLD
#if defined(RGB_MATRIX_ENABLE)
#undef RGB_MATRIX_MAXIMUM_BRIGHTNESS
diff --git a/keyboards/thevankeyboards/minivan/keymaps/belak/config.h b/keyboards/thevankeyboards/minivan/keymaps/belak/config.h
index 47d96a29d8d4c5e9ce6f0a030cb0402b35bcf2ad..488ffa5418175c87ac840efb5522162a21a219d7 100644
--- a/keyboards/thevankeyboards/minivan/keymaps/belak/config.h
+++ b/keyboards/thevankeyboards/minivan/keymaps/belak/config.h
@@ -4,5 +4,6 @@
#include "../../config.h"
#define TAPPING_TERM 500
+#define PERMISSIVE_HOLD
#endif
diff --git a/keyboards/thevankeyboards/minivan/keymaps/halvves/config.h b/keyboards/thevankeyboards/minivan/keymaps/halvves/config.h
index 6be8d217bd5b0f21a8822e3f1a2dd3db9163b4e9..c6404f8ce5732d39a441c8fe6b9ade136a94acfe 100644
--- a/keyboards/thevankeyboards/minivan/keymaps/halvves/config.h
+++ b/keyboards/thevankeyboards/minivan/keymaps/halvves/config.h
@@ -1,6 +1,7 @@
#pragma once
#define TAPPING_TERM 505
+#define PERMISSIVE_HOLD
#define RETRO_TAPPING
// smooth mousekeys (copied from the ergo ez config)
diff --git a/keyboards/woodkeys/bigseries/1key/keymaps/dudeofawesome/config.h b/keyboards/woodkeys/bigseries/1key/keymaps/dudeofawesome/config.h
index 30b86224c644d40d4809dd492c3613a92c39c974..131c755d4a474fe51695615474a07893beac9345 100644
--- a/keyboards/woodkeys/bigseries/1key/keymaps/dudeofawesome/config.h
+++ b/keyboards/woodkeys/bigseries/1key/keymaps/dudeofawesome/config.h
@@ -19,5 +19,6 @@ along with this program. If not, see .
#define CONFIG_USER_H
#define TAPPING_TERM 1000
+#define PERMISSIVE_HOLD
#endif
diff --git a/keyboards/xiudi/xd002/keymaps/tap_dance/config.h b/keyboards/xiudi/xd002/keymaps/tap_dance/config.h
index b86e862d30d35fa79c63885b2b098898a590ae7a..1fd93f875fa3abb51ef56ac5e3a2a90ed8311afe 100644
--- a/keyboards/xiudi/xd002/keymaps/tap_dance/config.h
+++ b/keyboards/xiudi/xd002/keymaps/tap_dance/config.h
@@ -1,3 +1,4 @@
#pragma once
#define TAPPING_TERM 500
+#define PERMISSIVE_HOLD
diff --git a/keyboards/zfrontier/big_switch/config.h b/keyboards/zfrontier/big_switch/config.h
index ddec2b2796a90b11113197cfa15f6324176d8142..99bd790caece1f7d35855de23a6b0f2cd4735a0f 100644
--- a/keyboards/zfrontier/big_switch/config.h
+++ b/keyboards/zfrontier/big_switch/config.h
@@ -51,3 +51,4 @@ along with this program. If not, see .
/* long tapping config */
#define TAPPING_TERM 500
+#define PERMISSIVE_HOLD
diff --git a/layouts/community/66_ansi/xyverz/config.h b/layouts/community/66_ansi/xyverz/config.h
index 06e5830af8f5ba2973e4a34b43435844855e36e4..37a57dbffd031a22624bb25efb9d80406737992c 100644
--- a/layouts/community/66_ansi/xyverz/config.h
+++ b/layouts/community/66_ansi/xyverz/config.h
@@ -1,5 +1,6 @@
#pragma once
#define TAPPING_TERM 600 // ms
+#define PERMISSIVE_HOLD
#undef RGBLIGHT_HUE_STEP
#define RGBLIGHT_HUE_STEP 8
diff --git a/layouts/community/ergodox/adam/config.h b/layouts/community/ergodox/adam/config.h
index 62e82d8b2bf6137422f57e50e7b0455dd0ddb632..1555ae11fd9bce1f4a1df1608ecce94e7c6f4296 100644
--- a/layouts/community/ergodox/adam/config.h
+++ b/layouts/community/ergodox/adam/config.h
@@ -1,5 +1,5 @@
#pragma once
#undef TAPPING_TERM
-#define TAPPING_TERM 300 //At 500 some bad logic takes hold
+#define TAPPING_TERM 300
#define IGNORE_MOD_TAP_INTERRUPT
diff --git a/quantum/action_tapping.c b/quantum/action_tapping.c
index 3c8b5678b794941af0a8d9325d1041b2e9652248..df3317ac05b22270ec2ffd39313086c0fee0a953 100644
--- a/quantum/action_tapping.c
+++ b/quantum/action_tapping.c
@@ -125,7 +125,7 @@ void action_tapping_process(keyrecord_t record) {
/* return true when key event is processed or consumed. */
bool process_tapping(keyrecord_t *keyp) {
keyevent_t event = keyp->event;
-# if (defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)) || defined(TAPPING_TERM_PER_KEY) || defined(PERMISSIVE_HOLD_PER_KEY) || defined(TAPPING_FORCE_HOLD_PER_KEY) || defined(HOLD_ON_OTHER_KEY_PRESS_PER_KEY)
+# if (defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)) || defined(PERMISSIVE_HOLD_PER_KEY) || defined(TAPPING_FORCE_HOLD_PER_KEY) || defined(HOLD_ON_OTHER_KEY_PRESS_PER_KEY)
uint16_t tapping_keycode = get_record_keycode(&tapping_key, false);
# endif
@@ -164,17 +164,15 @@ bool process_tapping(keyrecord_t *keyp) {
* useful for long TAPPING_TERM but may prevent fast typing.
*/
// clang-format off
-# if defined(TAPPING_TERM_PER_KEY) || (TAPPING_TERM >= 500) || defined(PERMISSIVE_HOLD) || defined(PERMISSIVE_HOLD_PER_KEY) || (defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT))
+# if defined(PERMISSIVE_HOLD) || defined(PERMISSIVE_HOLD_PER_KEY) || (defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT))
else if (
(
- (
- GET_TAPPING_TERM(tapping_keycode, &tapping_key) >= 500
+ IS_RELEASED(event) && waiting_buffer_typed(event)
# ifdef PERMISSIVE_HOLD_PER_KEY
- || get_permissive_hold(tapping_keycode, &tapping_key)
+ && get_permissive_hold(tapping_keycode, &tapping_key)
# elif defined(PERMISSIVE_HOLD)
- || true
+ && true
# endif
- ) && IS_RELEASED(event) && waiting_buffer_typed(event)
)
// Causes nested taps to not wait past TAPPING_TERM/RETRO_SHIFT
// unnecessarily and fixes them for Layer Taps.
diff --git a/users/hvp/config.h b/users/hvp/config.h
index 68dd8b48280815d59b3d927d6e0b82469390bd33..b7d0443bbc028ab679157aab77747807467829ef 100644
--- a/users/hvp/config.h
+++ b/users/hvp/config.h
@@ -15,4 +15,5 @@
*/
#pragma once
-#define LONG_TAPPING_TERM 1000
\ No newline at end of file
+#define LONG_TAPPING_TERM 1000
+#define PERMISSIVE_HOLD