summaryrefslogtreecommitdiff
path: root/quantum/process_keycode/process_tap_dance.c
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2022-04-16 20:24:09 +0200
committerGitHub <noreply@github.com>2022-04-16 11:24:09 -0700
commit8f585153c470b07bb0c529ff49b39ef45f68d37e (patch)
tree5441986fa041cd2d966b800af3f82d69b55e4d58 /quantum/process_keycode/process_tap_dance.c
parentcad0af09a8a280d918b726eb472c86065dc5c079 (diff)
Add GET_TAPPING_TERM macro to reduce duplicate code (#16681)
* Add GET_TAPPING_TERM macro to reduce duplicate code The macro gives the right tapping term depending on whether per-key tapping terms and/or dynamic tapping terms are enabled. Unnecessary function calls and variable resolution are avoided. Fixes #16472. * Use GET_TAPPING_TERM for Cirque trackpads Co-authored-by: Stefan Kerkmann <karlk90@pm.me>
Diffstat (limited to 'quantum/process_keycode/process_tap_dance.c')
-rw-r--r--quantum/process_keycode/process_tap_dance.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c
index e99119b2ae..db8df5f870 100644
--- a/quantum/process_keycode/process_tap_dance.c
+++ b/quantum/process_keycode/process_tap_dance.c
@@ -174,11 +174,7 @@ void tap_dance_task() {
if (action->custom_tapping_term > 0) {
tap_user_defined = action->custom_tapping_term;
} else {
-#ifdef TAPPING_TERM_PER_KEY
- tap_user_defined = get_tapping_term(action->state.keycode, &(keyrecord_t){});
-#else
- tap_user_defined = TAPPING_TERM;
-#endif
+ tap_user_defined = GET_TAPPING_TERM(action->state.keycode, &(keyrecord_t){});
}
if (action->state.count && timer_elapsed(action->state.timer) > tap_user_defined) {
process_tap_dance_action_on_dance_finished(action);