From f8130a6b83f3a94ce24ed73e0a4fb665d07fd249 Mon Sep 17 00:00:00 2001 From: Dongfeng Yu <60870777+blockader@users.noreply.github.com> Date: Wed, 17 Jun 2020 22:41:00 +0800 Subject: [PATCH 1/3] Allowing Pressing the Start Buttons Again to Stop Dynamic Macro Recording --- docs/feature_dynamic_macros.md | 2 +- 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 b86df6c60ffe..137b0eefb949 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 2065f242db9e..df3a8a812056 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); From 0595d93f7ae5bda9fb66724a4395e3aa3dd58924 Mon Sep 17 00:00:00 2001 From: Dongfeng Yu <60870777+blockader@users.noreply.github.com> Date: Mon, 22 Jun 2020 21:29:47 +0800 Subject: [PATCH 2/3] Adding Testing Files --- keyboards/dz60/keymaps/blockader/keymap.c | 5 +++++ keyboards/dz60/rules.mk | 1 + 2 files changed, 6 insertions(+) create mode 100644 keyboards/dz60/keymaps/blockader/keymap.c diff --git a/keyboards/dz60/keymaps/blockader/keymap.c b/keyboards/dz60/keymaps/blockader/keymap.c new file mode 100644 index 000000000000..c83b84e1f9ca --- /dev/null +++ b/keyboards/dz60/keymaps/blockader/keymap.c @@ -0,0 +1,5 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {LAYOUT(RESET, DYN_REC_START1, DYN_REC_START2, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, DYN_REC_STOP, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, XXXXXXX, KC_BSPC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, XXXXXXX, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, XXXXXXX, XXXXXXX, MO(1), KC_RCTL), + + LAYOUT(KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_DEL, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______)}; diff --git a/keyboards/dz60/rules.mk b/keyboards/dz60/rules.mk index 55e5bada3999..c0c86fe7e34c 100644 --- a/keyboards/dz60/rules.mk +++ b/keyboards/dz60/rules.mk @@ -31,3 +31,4 @@ AUDIO_ENABLE = no # Audio output FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches LAYOUTS = 60_ansi 60_ansi_split_bs_rshift 60_hhkb 60_iso 60_abnt2 60_tsangan_hhkb +DYNAMIC_MACRO_ENABLE = yes From f2d2213218bf126a8b92a667264a2f2891a41023 Mon Sep 17 00:00:00 2001 From: Dongfeng Yu <60870777+blockader@users.noreply.github.com> Date: Sat, 27 Jun 2020 17:35:06 +0800 Subject: [PATCH 3/3] Revert "Adding Testing Files" This reverts commit 0595d93f7ae5bda9fb66724a4395e3aa3dd58924. --- keyboards/dz60/keymaps/blockader/keymap.c | 5 ----- keyboards/dz60/rules.mk | 1 - 2 files changed, 6 deletions(-) delete mode 100644 keyboards/dz60/keymaps/blockader/keymap.c diff --git a/keyboards/dz60/keymaps/blockader/keymap.c b/keyboards/dz60/keymaps/blockader/keymap.c deleted file mode 100644 index c83b84e1f9ca..000000000000 --- a/keyboards/dz60/keymaps/blockader/keymap.c +++ /dev/null @@ -1,5 +0,0 @@ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {LAYOUT(RESET, DYN_REC_START1, DYN_REC_START2, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, DYN_REC_STOP, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, XXXXXXX, KC_BSPC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, XXXXXXX, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, XXXXXXX, XXXXXXX, MO(1), KC_RCTL), - - LAYOUT(KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_DEL, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______)}; diff --git a/keyboards/dz60/rules.mk b/keyboards/dz60/rules.mk index c0c86fe7e34c..55e5bada3999 100644 --- a/keyboards/dz60/rules.mk +++ b/keyboards/dz60/rules.mk @@ -31,4 +31,3 @@ AUDIO_ENABLE = no # Audio output FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches LAYOUTS = 60_ansi 60_ansi_split_bs_rshift 60_hhkb 60_iso 60_abnt2 60_tsangan_hhkb -DYNAMIC_MACRO_ENABLE = yes