summaryrefslogtreecommitdiff
path: root/quantum/action_tapping.c
diff options
context:
space:
mode:
authorprecondition <57645186+precondition@users.noreply.github.com>2021-11-25 20:06:50 +0000
committerGitHub <noreply@github.com>2021-11-26 07:06:50 +1100
commit4bac5f53d864a77a6f0fa8a2a046ed7748824ecc (patch)
tree75153ff862bdb0644e9d7622c1b80517e10a30f8 /quantum/action_tapping.c
parent5e9c29da0df045b03ada9278c34f37b22349a6f7 (diff)
New feature: `DYNAMIC_TAPPING_TERM_ENABLE` (#11036)
* New feature: `DYNAMIC_TAPPING_TERM_ENABLE` 3 new quantum keys to configure the tapping term on the fly. * Replace sprintf call in tapping_term_report by get_u16_str * Replace tab with 4 spaces
Diffstat (limited to 'quantum/action_tapping.c')
-rw-r--r--quantum/action_tapping.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/quantum/action_tapping.c b/quantum/action_tapping.c
index 0586fad421..b64d8b710b 100644
--- a/quantum/action_tapping.c
+++ b/quantum/action_tapping.c
@@ -24,12 +24,14 @@
# define IS_TAPPING_RECORD(r) (IS_TAPPING() && KEYEQ(tapping_key.event.key, (r->event.key)) && tapping_key.keycode == r->keycode)
# endif
-__attribute__((weak)) uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { return TAPPING_TERM; }
+uint16_t g_tapping_term = TAPPING_TERM;
+
+__attribute__((weak)) uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { return g_tapping_term; }
# ifdef TAPPING_TERM_PER_KEY
# define WITHIN_TAPPING_TERM(e) (TIMER_DIFF_16(e.time, tapping_key.event.time) < get_tapping_term(get_record_keycode(&tapping_key, false), &tapping_key))
# else
-# define WITHIN_TAPPING_TERM(e) (TIMER_DIFF_16(e.time, tapping_key.event.time) < TAPPING_TERM)
+# define WITHIN_TAPPING_TERM(e) (TIMER_DIFF_16(e.time, tapping_key.event.time) < g_tapping_term)
# endif
# ifdef TAPPING_FORCE_HOLD_PER_KEY
@@ -158,7 +160,7 @@ bool process_tapping(keyrecord_t *keyp) {
# ifdef TAPPING_TERM_PER_KEY
get_tapping_term(tapping_keycode, keyp)
# else
- TAPPING_TERM
+ g_tapping_term
# endif
>= 500
)