aboutsummaryrefslogtreecommitdiff
path: root/quantum/action_tapping.c
diff options
context:
space:
mode:
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 0586fad42..b64d8b710 100644
--- a/quantum/action_tapping.c
+++ b/quantum/action_tapping.c
@@ -24,12 +24,14 @@
24# define IS_TAPPING_RECORD(r) (IS_TAPPING() && KEYEQ(tapping_key.event.key, (r->event.key)) && tapping_key.keycode == r->keycode) 24# define IS_TAPPING_RECORD(r) (IS_TAPPING() && KEYEQ(tapping_key.event.key, (r->event.key)) && tapping_key.keycode == r->keycode)
25# endif 25# endif
26 26
27__attribute__((weak)) uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { return TAPPING_TERM; } 27uint16_t g_tapping_term = TAPPING_TERM;
28
29__attribute__((weak)) uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { return g_tapping_term; }
28 30
29# ifdef TAPPING_TERM_PER_KEY 31# ifdef TAPPING_TERM_PER_KEY
30# 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)) 32# 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))
31# else 33# else
32# define WITHIN_TAPPING_TERM(e) (TIMER_DIFF_16(e.time, tapping_key.event.time) < TAPPING_TERM) 34# define WITHIN_TAPPING_TERM(e) (TIMER_DIFF_16(e.time, tapping_key.event.time) < g_tapping_term)
33# endif 35# endif
34 36
35# ifdef TAPPING_FORCE_HOLD_PER_KEY 37# ifdef TAPPING_FORCE_HOLD_PER_KEY
@@ -158,7 +160,7 @@ bool process_tapping(keyrecord_t *keyp) {
158# ifdef TAPPING_TERM_PER_KEY 160# ifdef TAPPING_TERM_PER_KEY
159 get_tapping_term(tapping_keycode, keyp) 161 get_tapping_term(tapping_keycode, keyp)
160# else 162# else
161 TAPPING_TERM 163 g_tapping_term
162# endif 164# endif
163 >= 500 165 >= 500
164 ) 166 )