aboutsummaryrefslogtreecommitdiff
path: root/keyboards
diff options
context:
space:
mode:
authorDrashna Jaelre <[email protected]>2024-08-17 17:35:10 -0700
committerGitHub <[email protected]>2024-08-18 01:35:10 +0100
commitab4c13e835060f6fb921a7d206e28f9525d34178 (patch)
treebd5f272dccf280f21596f43fd15c275d09d78d3c /keyboards
parentfaf51c7449880d38a006a19bf900be547177928a (diff)
downloadqmk_firmware-ab4c13e835060f6fb921a7d206e28f9525d34178.tar.gz
qmk_firmware-ab4c13e835060f6fb921a7d206e28f9525d34178.zip
Add dynamic macro keyboard callbacks (#24142)
Diffstat (limited to 'keyboards')
-rw-r--r--keyboards/ergodox_ez/ergodox_ez.c12
-rw-r--r--keyboards/ibm/model_m/mschwingen/mschwingen.c12
-rw-r--r--keyboards/zsa/moonlander/moonlander.c14
-rw-r--r--keyboards/zsa/voyager/voyager.c12
4 files changed, 42 insertions, 8 deletions
diff --git a/keyboards/ergodox_ez/ergodox_ez.c b/keyboards/ergodox_ez/ergodox_ez.c
index 5fc173917f..e23231ecb8 100644
--- a/keyboards/ergodox_ez/ergodox_ez.c
+++ b/keyboards/ergodox_ez/ergodox_ez.c
@@ -382,15 +382,23 @@ static bool is_on = false;
static bool is_dynamic_recording = false;
static uint16_t dynamic_loop_timer;
-void dynamic_macro_record_start_user(int8_t direction) {
+bool dynamic_macro_record_start_kb(int8_t direction) {
+ if (!dynamic_macro_record_start_user(direction)) {
+ return false;
+ }
is_dynamic_recording = true;
dynamic_loop_timer = timer_read();
ergodox_right_led_1_on();
+ return true;
}
-void dynamic_macro_record_end_user(int8_t direction) {
+bool dynamic_macro_record_end_kb(int8_t direction) {
+ if (!dynamic_macro_record_end_user(direction)) {
+ return false;
+ }
is_dynamic_recording = false;
layer_state_set_user(layer_state);
+ return true;
}
#endif
diff --git a/keyboards/ibm/model_m/mschwingen/mschwingen.c b/keyboards/ibm/model_m/mschwingen/mschwingen.c
index 11407d1206..7c0f1b2565 100644
--- a/keyboards/ibm/model_m/mschwingen/mschwingen.c
+++ b/keyboards/ibm/model_m/mschwingen/mschwingen.c
@@ -206,11 +206,19 @@ void update_layer_leds(void) {
#endif
-void dynamic_macro_record_start_user(int8_t direction) {
+bool dynamic_macro_record_start_kb(int8_t direction) {
+ if (!dynamic_macro_record_start_user(direction)) {
+ return false;
+ }
isRecording++;
blink_cycle_timer = timer_read();
+ return true;
}
-void dynamic_macro_record_end_user(int8_t direction) {
+bool dynamic_macro_record_end_kb(int8_t direction) {
+ if (!dynamic_macro_record_end_user(direction)) {
+ return false;
+ }
if (isRecording) isRecording--;
+ return true;
}
diff --git a/keyboards/zsa/moonlander/moonlander.c b/keyboards/zsa/moonlander/moonlander.c
index 02c64f4b96..0584e8cd31 100644
--- a/keyboards/zsa/moonlander/moonlander.c
+++ b/keyboards/zsa/moonlander/moonlander.c
@@ -26,11 +26,21 @@ bool is_launching = false;
#ifdef DYNAMIC_MACRO_ENABLE
static bool is_dynamic_recording = false;
-void dynamic_macro_record_start_user(int8_t direction) { is_dynamic_recording = true; }
+bool dynamic_macro_record_start_kb(int8_t direction) {
+ if (!dynamic_macro_record_start_user(direction)) {
+ return false;
+ }
+ is_dynamic_recording = true;
+ return true;
+}
-void dynamic_macro_record_end_user(int8_t direction) {
+bool dynamic_macro_record_end_kb(int8_t direction) {
+ if (!dynamic_macro_record_end_user(direction)) {
+ return false;
+ }
is_dynamic_recording = false;
ML_LED_3(false);
+ return false;
}
#endif
diff --git a/keyboards/zsa/voyager/voyager.c b/keyboards/zsa/voyager/voyager.c
index 3255f25a97..69d42bba1a 100644
--- a/keyboards/zsa/voyager/voyager.c
+++ b/keyboards/zsa/voyager/voyager.c
@@ -21,18 +21,26 @@ static uint32_t dynamic_macro_led(uint32_t trigger_time, void *cb_arg) {
return 100;
}
-void dynamic_macro_record_start_user(int8_t direction) {
+bool dynamic_macro_record_start_kb(int8_t direction) {
+ if (!dynamic_macro_record_start_user(direction)) {
+ return false;
+ }
if (dynamic_macro_token == INVALID_DEFERRED_TOKEN) {
STATUS_LED_3(true);
dynamic_macro_token = defer_exec(100, dynamic_macro_led, NULL);
}
+ return true;
}
-void dynamic_macro_record_end_user(int8_t direction) {
+bool dynamic_macro_record_end_kb(int8_t direction) {
+ if (!dynamic_macro_record_end_user(direction)) {
+ return false;
+ }
if (cancel_deferred_exec(dynamic_macro_token)) {
dynamic_macro_token = INVALID_DEFERRED_TOKEN;
STATUS_LED_3(false);
}
+ return true;
}
# endif