diff options
| author | Jouke Witteveen <j.witteveen@gmail.com> | 2022-04-16 20:24:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-16 11:24:09 -0700 |
| commit | 8f585153c470b07bb0c529ff49b39ef45f68d37e (patch) | |
| tree | 5441986fa041cd2d966b800af3f82d69b55e4d58 /quantum/process_keycode/process_auto_shift.c | |
| parent | cad0af09a8a280d918b726eb472c86065dc5c079 (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_auto_shift.c')
| -rw-r--r-- | quantum/process_keycode/process_auto_shift.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/quantum/process_keycode/process_auto_shift.c b/quantum/process_keycode/process_auto_shift.c index 2150edd7b2..e6a7c01f2a 100644 --- a/quantum/process_keycode/process_auto_shift.c +++ b/quantum/process_keycode/process_auto_shift.c | |||
| @@ -182,12 +182,7 @@ static bool autoshift_press(uint16_t keycode, uint16_t now, keyrecord_t *record) | |||
| 182 | # endif | 182 | # endif |
| 183 | ) && | 183 | ) && |
| 184 | # endif | 184 | # endif |
| 185 | TIMER_DIFF_16(now, autoshift_time) < | 185 | TIMER_DIFF_16(now, autoshift_time) < GET_TAPPING_TERM(autoshift_lastkey, record) |
| 186 | # ifdef TAPPING_TERM_PER_KEY | ||
| 187 | get_tapping_term(autoshift_lastkey, record) | ||
| 188 | # else | ||
| 189 | TAPPING_TERM | ||
| 190 | # endif | ||
| 191 | ) { | 186 | ) { |
| 192 | // clang-format on | 187 | // clang-format on |
| 193 | // Allow a tap-then-hold for keyrepeat. | 188 | // Allow a tap-then-hold for keyrepeat. |
