diff options
| author | Jason Ken Adhinarta <35003073+jasonkena@users.noreply.github.com> | 2022-10-03 03:26:47 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-03 18:26:47 +1100 |
| commit | c0e6a28bc62f659b0564a203df670d81a89a3bb4 (patch) | |
| tree | 9152f717b1bf86195e3c0a73a4629b59723a9e6b /quantum/process_keycode/process_dynamic_macro.c | |
| parent | de19cb7b22c6c621f19a2e0d6e933d1f2faa9745 (diff) | |
Prevent tap dance from wiping dynamic macros (#17880)
Diffstat (limited to 'quantum/process_keycode/process_dynamic_macro.c')
| -rw-r--r-- | quantum/process_keycode/process_dynamic_macro.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/quantum/process_keycode/process_dynamic_macro.c b/quantum/process_keycode/process_dynamic_macro.c index a7555fdd40..41207092a9 100644 --- a/quantum/process_keycode/process_dynamic_macro.c +++ b/quantum/process_keycode/process_dynamic_macro.c | |||
| @@ -45,6 +45,10 @@ __attribute__((weak)) void dynamic_macro_record_end_user(int8_t direction) { | |||
| 45 | dynamic_macro_led_blink(); | 45 | dynamic_macro_led_blink(); |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | __attribute__((weak)) bool dynamic_macro_valid_key_user(uint16_t keycode, keyrecord_t *record) { | ||
| 49 | return true; | ||
| 50 | } | ||
| 51 | |||
| 48 | /* Convenience macros used for retrieving the debug info. All of them | 52 | /* Convenience macros used for retrieving the debug info. All of them |
| 49 | * need a `direction` variable accessible at the call site. | 53 | * need a `direction` variable accessible at the call site. |
| 50 | */ | 54 | */ |
| @@ -252,14 +256,16 @@ bool process_dynamic_macro(uint16_t keycode, keyrecord_t *record) { | |||
| 252 | return false; | 256 | return false; |
| 253 | #endif | 257 | #endif |
| 254 | default: | 258 | default: |
| 255 | /* Store the key in the macro buffer and process it normally. */ | 259 | if (dynamic_macro_valid_key_user(keycode, record)) { |
| 256 | switch (macro_id) { | 260 | /* Store the key in the macro buffer and process it normally. */ |
| 257 | case 1: | 261 | switch (macro_id) { |
| 258 | dynamic_macro_record_key(macro_buffer, ¯o_pointer, r_macro_end, +1, record); | 262 | case 1: |
| 259 | break; | 263 | dynamic_macro_record_key(macro_buffer, ¯o_pointer, r_macro_end, +1, record); |
| 260 | case 2: | 264 | break; |
| 261 | dynamic_macro_record_key(r_macro_buffer, ¯o_pointer, macro_end, -1, record); | 265 | case 2: |
| 262 | break; | 266 | dynamic_macro_record_key(r_macro_buffer, ¯o_pointer, macro_end, -1, record); |
| 267 | break; | ||
| 268 | } | ||
| 263 | } | 269 | } |
| 264 | return true; | 270 | return true; |
| 265 | break; | 271 | break; |
