summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Didron <fdidron@users.noreply.github.com>2021-03-18 10:07:50 +0900
committerGitHub <noreply@github.com>2021-03-18 10:07:50 +0900
commit53d1cfb7058b5010556f85dd527fc6db4596364e (patch)
tree2a40927ee5fd7ab19b8464c5114881037c635299
parent1b29979433b25c83c15f851dc8156efba704b1e2 (diff)
Adds caps lock led status on Moonlander/Ergodox (#332)
* feat: adds caps lock led status on Moonlander/Ergodox * fix: botched source file * fix: light up the most right leds
-rw-r--r--keyboards/ergodox_ez/ergodox_ez.c13
-rw-r--r--keyboards/moonlander/moonlander.c15
2 files changed, 27 insertions, 1 deletions
diff --git a/keyboards/ergodox_ez/ergodox_ez.c b/keyboards/ergodox_ez/ergodox_ez.c
index a2bbbfe09d..6b76b1d8cb 100644
--- a/keyboards/ergodox_ez/ergodox_ez.c
+++ b/keyboards/ergodox_ez/ergodox_ez.c
@@ -470,5 +470,18 @@ void matrix_scan_kb(void) {
}
#endif
+#ifdef CAPS_LOCK_STATUS
+ led_t led_state = host_keyboard_led_state();
+ if(led_state.caps_lock) {
+ ergodox_right_led_3_on();
+ }
+ else {
+ uint8_t layer = get_highest_layer(layer_state);
+ if(layer != 1) {
+ ergodox_right_led_3_off();
+ }
+ }
+#endif
+
matrix_scan_user();
}
diff --git a/keyboards/moonlander/moonlander.c b/keyboards/moonlander/moonlander.c
index 52cccc9727..42c119c2d9 100644
--- a/keyboards/moonlander/moonlander.c
+++ b/keyboards/moonlander/moonlander.c
@@ -128,7 +128,20 @@ void moonlander_led_task(void) {
wait_ms(150);
}
#endif
-
+#ifdef CAPS_LOCK_STATUS
+ else {
+ led_t led_state = host_keyboard_led_state();
+ if(led_state.caps_lock) {
+ ML_LED_6(true);
+ }
+ else {
+ uint8_t layer = get_highest_layer(layer_state);
+ if(layer != 1) {
+ ML_LED_6(false);
+ }
+ }
+ }
+#endif
}
static THD_WORKING_AREA(waLEDThread, 128);