Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowing Pressing the Start Buttons Again to Stop Dynamic Macro Recording #9446

Merged
merged 3 commits into from
Jul 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/feature_dynamic_macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
8 changes: 5 additions & 3 deletions quantum/process_keycode/process_dynamic_macro.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, &macro_end);
Expand Down