diff options
author | Jouke Witteveen <[email protected]> | 2022-04-16 20:24:09 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2022-04-16 11:24:09 -0700 |
commit | 8f585153c470b07bb0c529ff49b39ef45f68d37e (patch) | |
tree | 5441986fa041cd2d966b800af3f82d69b55e4d58 /quantum/process_keycode/process_space_cadet.c | |
parent | cad0af09a8a280d918b726eb472c86065dc5c079 (diff) | |
download | qmk_firmware-8f585153c470b07bb0c529ff49b39ef45f68d37e.tar.gz qmk_firmware-8f585153c470b07bb0c529ff49b39ef45f68d37e.zip |
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 <[email protected]>
Diffstat (limited to 'quantum/process_keycode/process_space_cadet.c')
-rw-r--r-- | quantum/process_keycode/process_space_cadet.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/quantum/process_keycode/process_space_cadet.c b/quantum/process_keycode/process_space_cadet.c index 46b2648c35..0997e7b7f3 100644 --- a/quantum/process_keycode/process_space_cadet.c +++ b/quantum/process_keycode/process_space_cadet.c @@ -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)); |