aboutsummaryrefslogtreecommitdiff
path: root/quantum/process_keycode/process_led_matrix.c
diff options
context:
space:
mode:
authorRyan <[email protected]>2024-04-11 14:06:36 +1000
committerGitHub <[email protected]>2024-04-11 14:06:36 +1000
commit25f608c1b437060e8c9b451ed81c7e37a2531284 (patch)
treed49488270685d04b7ff8a017946497d21b9d16ea /quantum/process_keycode/process_led_matrix.c
parent4acdddbf48707e5221cb754b4aa5caf32ce28276 (diff)
downloadqmk_firmware-25f608c1b437060e8c9b451ed81c7e37a2531284.tar.gz
qmk_firmware-25f608c1b437060e8c9b451ed81c7e37a2531284.zip
Separate keycode handling for LED Matrix and Backlight (#23426)
Diffstat (limited to 'quantum/process_keycode/process_led_matrix.c')
-rw-r--r--quantum/process_keycode/process_led_matrix.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/quantum/process_keycode/process_led_matrix.c b/quantum/process_keycode/process_led_matrix.c
new file mode 100644
index 0000000000..217c9a2c28
--- /dev/null
+++ b/quantum/process_keycode/process_led_matrix.c
@@ -0,0 +1,32 @@
+// Copyright 2024 QMK
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "process_led_matrix.h"
+#include "led_matrix.h"
+
+bool process_led_matrix(uint16_t keycode, keyrecord_t *record) {
+ if (record->event.pressed) {
+ switch (keycode) {
+ case QK_BACKLIGHT_ON:
+ led_matrix_enable();
+ return false;
+ case QK_BACKLIGHT_OFF:
+ led_matrix_disable();
+ return false;
+ case QK_BACKLIGHT_DOWN:
+ led_matrix_decrease_val();
+ return false;
+ case QK_BACKLIGHT_UP:
+ led_matrix_increase_val();
+ return false;
+ case QK_BACKLIGHT_TOGGLE:
+ led_matrix_toggle();
+ return false;
+ case QK_BACKLIGHT_STEP:
+ led_matrix_step();
+ return false;
+ }
+ }
+
+ return true;
+}