diff options
author | Johannes H. Jensen <joh@pseudoberries.com> | 2023-04-03 05:01:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-03 13:01:07 +1000 |
commit | 68efea70b268aceb28c28abb26641fad8d6acefd (patch) | |
tree | e26fe123a2ca166d9e958d618bbafc2577fbab00 /quantum | |
parent | 9a68472da87bea6eb9e209b8cf90de09211f23c8 (diff) |
Add direction to dynamic_macro_record_start_user (#19689)
Diffstat (limited to 'quantum')
-rw-r--r-- | quantum/process_keycode/process_dynamic_macro.c | 10 | ||||
-rw-r--r-- | quantum/process_keycode/process_dynamic_macro.h | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/quantum/process_keycode/process_dynamic_macro.c b/quantum/process_keycode/process_dynamic_macro.c index c2e7e7716f..bf6af566e2 100644 --- a/quantum/process_keycode/process_dynamic_macro.c +++ b/quantum/process_keycode/process_dynamic_macro.c @@ -29,7 +29,7 @@ void dynamic_macro_led_blink(void) { /* User hooks for Dynamic Macros */ -__attribute__((weak)) void dynamic_macro_record_start_user(void) { +__attribute__((weak)) void dynamic_macro_record_start_user(int8_t direction) { dynamic_macro_led_blink(); } @@ -62,10 +62,10 @@ __attribute__((weak)) bool dynamic_macro_valid_key_user(uint16_t keycode, keyrec * @param[out] macro_pointer The new macro buffer iterator. * @param[in] macro_buffer The macro buffer used to initialize macro_pointer. */ -void dynamic_macro_record_start(keyrecord_t **macro_pointer, keyrecord_t *macro_buffer) { +void dynamic_macro_record_start(keyrecord_t **macro_pointer, keyrecord_t *macro_buffer, int8_t direction) { dprintln("dynamic macro recording: started"); - dynamic_macro_record_start_user(); + dynamic_macro_record_start_user(direction); clear_keyboard(); layer_clear(); @@ -213,11 +213,11 @@ bool process_dynamic_macro(uint16_t keycode, keyrecord_t *record) { if (!record->event.pressed) { switch (keycode) { case QK_DYNAMIC_MACRO_RECORD_START_1: - dynamic_macro_record_start(¯o_pointer, macro_buffer); + dynamic_macro_record_start(¯o_pointer, macro_buffer, +1); macro_id = 1; return false; case QK_DYNAMIC_MACRO_RECORD_START_2: - dynamic_macro_record_start(¯o_pointer, r_macro_buffer); + dynamic_macro_record_start(¯o_pointer, r_macro_buffer, -1); macro_id = 2; return false; case QK_DYNAMIC_MACRO_PLAY_1: diff --git a/quantum/process_keycode/process_dynamic_macro.h b/quantum/process_keycode/process_dynamic_macro.h index 39036541b8..ab70726897 100644 --- a/quantum/process_keycode/process_dynamic_macro.h +++ b/quantum/process_keycode/process_dynamic_macro.h @@ -35,7 +35,7 @@ void dynamic_macro_led_blink(void); bool process_dynamic_macro(uint16_t keycode, keyrecord_t *record); -void dynamic_macro_record_start_user(void); +void dynamic_macro_record_start_user(int8_t direction); void dynamic_macro_play_user(int8_t direction); void dynamic_macro_record_key_user(int8_t direction, keyrecord_t *record); void dynamic_macro_record_end_user(int8_t direction); |