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:
parent
cad0af09a8
commit
8f585153c4
7 changed files with 26 additions and 45 deletions
|
@ -93,12 +93,7 @@ void perform_space_cadet(keyrecord_t *record, uint16_t sc_keycode, uint8_t holdM
|
|||
register_mods(MOD_BIT(holdMod));
|
||||
}
|
||||
} else {
|
||||
#ifdef TAPPING_TERM_PER_KEY
|
||||
if (sc_last == holdMod && timer_elapsed(sc_timer) < get_tapping_term(sc_keycode, record))
|
||||
#else
|
||||
if (sc_last == holdMod && timer_elapsed(sc_timer) < TAPPING_TERM)
|
||||
#endif
|
||||
{
|
||||
if (sc_last == holdMod && timer_elapsed(sc_timer) < GET_TAPPING_TERM(sc_keycode, record)) {
|
||||
if (holdMod != tapMod) {
|
||||
if (IS_MOD(holdMod)) {
|
||||
unregister_mods(MOD_BIT(holdMod));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue