From 666cb44673c3db85e0141189319fc9aed394c56d Mon Sep 17 00:00:00 2001 From: Dongfeng Yu <60870777+blockader@users.noreply.github.com> Date: Wed, 8 Jul 2020 04:59:13 +0800 Subject: Allowing Pressing the Start Buttons Again to Stop Dynamic Macro Recording (#9446) --- quantum/process_keycode/process_dynamic_macro.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'quantum') diff --git a/quantum/process_keycode/process_dynamic_macro.c b/quantum/process_keycode/process_dynamic_macro.c index 2065f242db..df3a8a8120 100644 --- a/quantum/process_keycode/process_dynamic_macro.c +++ b/quantum/process_keycode/process_dynamic_macro.c @@ -216,11 +216,13 @@ bool process_dynamic_macro(uint16_t keycode, keyrecord_t *record) { } else { /* A macro is being recorded right now. */ switch (keycode) { + case DYN_REC_START1: + case DYN_REC_START2: case DYN_REC_STOP: /* Stop the macro recording. */ - if (record->event.pressed) { /* Ignore the initial release - * just after the recoding - * starts. */ + if (record->event.pressed ^ (keycode != DYN_REC_STOP)) { /* Ignore the initial release + * just after the recording + * starts for DYN_REC_STOP. */ switch (macro_id) { case 1: dynamic_macro_record_end(macro_buffer, macro_pointer, +1, ¯o_end); -- cgit v1.2.1