Skip to content

Commit

Permalink
Combo TAP_CODE_DELAY and clear_weak_mods (qmk#15866)
Browse files Browse the repository at this point in the history
Signed-off-by: Dušan <[email protected]>
  • Loading branch information
sevanteri authored and Dušan committed Dec 14, 2022
1 parent 6e05b9c commit f793d0a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions quantum/process_keycode/process_combo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -185,6 +186,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;
Expand All @@ -210,6 +214,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;
Expand Down

0 comments on commit f793d0a

Please sign in to comment.