diff options
author | Dongfeng Yu <60870777+blockader@users.noreply.github.com> | 2020-07-08 04:59:13 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-07 21:59:13 +0100 |
commit | 666cb44673c3db85e0141189319fc9aed394c56d (patch) | |
tree | e4a4ce639e51ef5f53c98939f59e5d21ca9afc35 | |
parent | 03c790a0f23fe05f0b0fde84d3a2d3e7987a7f73 (diff) | |
download | firmware-666cb44673c3db85e0141189319fc9aed394c56d.tar.gz firmware-666cb44673c3db85e0141189319fc9aed394c56d.tar.bz2 firmware-666cb44673c3db85e0141189319fc9aed394c56d.zip |
Allowing Pressing the Start Buttons Again to Stop Dynamic Macro Recording (#9446)
-rw-r--r-- | docs/feature_dynamic_macros.md | 2 | ||||
-rw-r--r-- | quantum/process_keycode/process_dynamic_macro.c | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/docs/feature_dynamic_macros.md b/docs/feature_dynamic_macros.md index b86df6c60..137b0eefb 100644 --- a/docs/feature_dynamic_macros.md +++ b/docs/feature_dynamic_macros.md @@ -18,7 +18,7 @@ That should be everything necessary. To start recording the macro, press either `DYN_REC_START1` or `DYN_REC_START2`. -To finish the recording, press the `DYN_REC_STOP` layer button. +To finish the recording, press the `DYN_REC_STOP` layer button. You can also press `DYN_REC_START1` or `DYN_REC_START2` again to stop the recording. To replay the macro, press either `DYN_MACRO_PLAY1` or `DYN_MACRO_PLAY2`. diff --git a/quantum/process_keycode/process_dynamic_macro.c b/quantum/process_keycode/process_dynamic_macro.c index 2065f242d..df3a8a812 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); |