1
0

Align use of keymap level _kb callbacks (#25774)

This commit is contained in:
Joel Challis
2025-11-11 22:00:28 +00:00
committed by GitHub
parent 8ec3de0f92
commit 98504424b1
13 changed files with 46 additions and 80 deletions

View File

@@ -42,25 +42,19 @@ const rgblight_segment_t PROGMEM ll_sl[] = RGBLIGHT_LAYER_SEGMENTS(
const rgblight_segment_t* const PROGMEM rgb_layers[] = RGBLIGHT_LAYERS_LIST(ll_none, ll_cl, ll_sl);
void keyboard_post_init_kb(void) {
void keyboard_post_init_user(void) {
rgblight_layers = rgb_layers;
keyboard_post_init_user();
}
bool led_update_kb(led_t led_state) {
bool res = led_update_user(led_state);
if (res) {
uint8_t lock_bits = led_state.scroll_lock << 1 | led_state.caps_lock;
for (uint8_t i=0; i<3; i++) {
rgblight_set_layer_state(i, false);
}
if (lock_bits < 3) {
rgblight_set_layer_state(lock_bits, true);
}
bool led_update_user(led_t led_state) {
uint8_t lock_bits = led_state.scroll_lock << 1 | led_state.caps_lock;
for (uint8_t i=0; i<3; i++) {
rgblight_set_layer_state(i, false);
}
if (lock_bits < 3) {
rgblight_set_layer_state(lock_bits, true);
}
return res;
return false;
}
#endif