1
0
Fork 0

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>
This commit is contained in:
Jouke Witteveen 2022-04-16 20:24:09 +02:00 committed by GitHub
parent cad0af09a8
commit 8f585153c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 26 additions and 45 deletions

View file

@ -182,12 +182,7 @@ static bool autoshift_press(uint16_t keycode, uint16_t now, keyrecord_t *record)
# endif
) &&
# endif
TIMER_DIFF_16(now, autoshift_time) <
# ifdef TAPPING_TERM_PER_KEY
get_tapping_term(autoshift_lastkey, record)
# else
TAPPING_TERM
# endif
TIMER_DIFF_16(now, autoshift_time) < GET_TAPPING_TERM(autoshift_lastkey, record)
) {
// clang-format on
// Allow a tap-then-hold for keyrepeat.