mirror of
https://github.com/jmwtsn/qmk_firmware.git
synced 2026-06-03 19:53:31 -03:00
Implement num lock light for Keychron V5 (#26019)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user