From 23f329abbda16464aa2cb7ed6f3226673b7a2137 Mon Sep 17 00:00:00 2001 From: Raheman Vaiya Date: Sun, 17 Dec 2023 03:22:57 -0500 Subject: [PATCH] overload: Fix macro repeat (#595) --- src/keyboard.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/keyboard.c b/src/keyboard.c index 4af48f5..ab2254d 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -604,8 +604,17 @@ static long process_descriptor(struct keyboard *kbd, uint8_t code, if (kbd->last_pressed_code == code && (!kbd->config.overload_tap_timeout || ((time - kbd->overload_start_time) < kbd->config.overload_tap_timeout))) { - process_descriptor(kbd, code, action, dl, 1, time); - process_descriptor(kbd, code, action, dl, 0, time); + if (action->op == OP_MACRO) { + /* + * Macro release relies on event logic, so we can't just synthesize a + * descriptor release. + */ + struct macro *macro = &kbd->config.macros[action->args[0].idx]; + execute_macro(kbd, dl, macro); + } else { + process_descriptor(kbd, code, action, dl, 1, time); + process_descriptor(kbd, code, action, dl, 0, time); + } } }