diff options
author | Pete Sevander <pete.sevander@gmail.com> | 2022-01-29 09:19:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-28 23:19:36 -0800 |
commit | d700447ddac307ab6b1e39b0485ddef76ed1fe7f (patch) | |
tree | b5965fd844377444068af82eeaf7b8d7b377a838 | |
parent | 8c1c37727229c43c522a3a1ec26584bce2e95ed6 (diff) |
Combo `TAP_CODE_DELAY` and `clear_weak_mods` (#15866)
-rw-r--r-- | quantum/process_keycode/process_combo.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/quantum/process_keycode/process_combo.c b/quantum/process_keycode/process_combo.c index 8040ede528..21fd737ab7 100644 --- a/quantum/process_keycode/process_combo.c +++ b/quantum/process_keycode/process_combo.c @@ -17,6 +17,7 @@ #include "print.h" #include "process_combo.h" #include "action_tapping.h" +#include "action.h" #ifdef COMBO_COUNT __attribute__((weak)) combo_t key_combos[COMBO_COUNT]; @@ -193,6 +194,9 @@ void clear_combos(void) { static inline void dump_key_buffer(void) { /* First call start from 0 index; recursive calls need to start from i+1 index */ static uint8_t key_buffer_next = 0; +#if TAP_CODE_DELAY > 0 + bool delay_done = false; +#endif if (key_buffer_size == 0) { return; @@ -218,6 +222,15 @@ static inline void dump_key_buffer(void) { #endif } record->event.time = 0; + clear_weak_mods(); + +#if TAP_CODE_DELAY > 0 + // only delay once and for a non-tapping key + if (!delay_done && !is_tap_record(record)) { + delay_done = true; + wait_ms(TAP_CODE_DELAY); + } +#endif } key_buffer_next = key_buffer_size = 0; |