Implement num lock light for Keychron V5 (#26019)

This commit is contained in:
Toast
2026-04-13 23:49:27 +02:00
committed by GitHub
parent 3001d81e3d
commit c6475e0476
5 changed files with 22 additions and 1 deletions
+3
View File
@@ -18,3 +18,6 @@
/* Enable caps-lock LED */
#define CAPS_LOCK_LED_INDEX 54
/* Enable num-lock LED */
#define NUM_LOCK_LED_INDEX 33
@@ -21,3 +21,6 @@
/* Enable caps-lock LED */
#define CAPS_LOCK_LED_INDEX 52
/* Enable num-lock LED */
#define NUM_LOCK_LED_INDEX 31
+3
View File
@@ -18,3 +18,6 @@
/* Enable caps-lock LED */
#define CAPS_LOCK_LED_INDEX 53
/* Enable num-lock LED */
#define NUM_LOCK_LED_INDEX 33
@@ -21,3 +21,6 @@
/* Enable caps-lock LED */
#define CAPS_LOCK_LED_INDEX 51
/* Enable num-lock LED */
#define NUM_LOCK_LED_INDEX 31
+10 -1
View File
@@ -30,7 +30,7 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
#endif // DIP_SWITCH_ENABLE
#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX)
#if defined(RGB_MATRIX_ENABLE) && (defined(CAPS_LOCK_LED_INDEX) || defined(NUM_LOCK_LED_INDEX))
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
if (!process_record_user(keycode, record)) { return false; }
@@ -69,6 +69,15 @@ bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
RGB_MATRIX_INDICATOR_SET_COLOR(CAPS_LOCK_LED_INDEX, 0, 0, 0);
}
}
#ifdef NUM_LOCK_LED_INDEX
if (host_keyboard_led_state().num_lock) {
RGB_MATRIX_INDICATOR_SET_COLOR(NUM_LOCK_LED_INDEX, 255, 255, 255);
} else {
if (!rgb_matrix_get_flags()) {
RGB_MATRIX_INDICATOR_SET_COLOR(NUM_LOCK_LED_INDEX, 0, 0, 0);
}
}
#endif
return true;
}