Fix Per Key LED Indicator Callbacks (#18450)
Co-authored-by: Dasky <32983009+daskygit@users.noreply.github.com> Co-authored-by: Nick Brassel <nick@tzarc.org>
This commit is contained in:
@@ -8,10 +8,10 @@
|
||||
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
|
||||
// Layer names don't all need to be of the same length, obviously, and you can also skip them
|
||||
// entirely and just use numbers.
|
||||
enum layers {
|
||||
_QWERTY,
|
||||
_LOWER,
|
||||
_RAISE,
|
||||
enum layers {
|
||||
_QWERTY,
|
||||
_LOWER,
|
||||
_RAISE,
|
||||
_NUMP,
|
||||
};
|
||||
|
||||
@@ -81,7 +81,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {[_QWERTY] = LAYOUT
|
||||
)};
|
||||
|
||||
//Per key lights
|
||||
void rgb_matrix_indicators_user(void) {
|
||||
bool rgb_matrix_indicators_user(void) {
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
switch (get_highest_layer(layer_state)) {
|
||||
case _QWERTY:
|
||||
@@ -179,7 +179,7 @@ void rgb_matrix_indicators_user(void) {
|
||||
case 15: // C key off
|
||||
case 20: // X key off
|
||||
case 21: // Z key off
|
||||
|
||||
|
||||
case 26: // shift key off
|
||||
case 52 ... 53: // right column off
|
||||
rgb_matrix_set_color(i, 0, 0, 0); // off
|
||||
@@ -256,6 +256,7 @@ void rgb_matrix_indicators_user(void) {
|
||||
rgb_matrix_set_color(14, 0, 255, 0); // Green layer active
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@@ -29,12 +29,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// https://github.com/foostan/crkbd/blob/main/corne-classic/doc/buildguide_en.md
|
||||
|
||||
// Change LED color to red when CAPS LOCK is active
|
||||
void rgb_matrix_indicators_user(void) {
|
||||
bool rgb_matrix_indicators_user(void) {
|
||||
if (host_keyboard_led_state().caps_lock) {
|
||||
rgb_matrix_set_color(26, 255, 0, 0);
|
||||
// Only works with SPLIT_LED_STATE_ENABLE
|
||||
rgb_matrix_set_color(53, 255, 0, 0);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// + ---- +
|
||||
@@ -128,4 +129,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
_______, _______, _______, _______, _______, _______
|
||||
//|--------------------------| |--------------------------|
|
||||
)
|
||||
};
|
||||
};
|
||||
|
@@ -342,7 +342,7 @@ void check_default_layer(uint8_t type) {
|
||||
}
|
||||
}
|
||||
|
||||
void rgb_matrix_indicators_user(void) {
|
||||
bool rgb_matrix_indicators_user(void) {
|
||||
if (
|
||||
user_config.rgb_layer_change && rgb_matrix_config.enable &&
|
||||
(!user_config.rgb_matrix_idle_anim || rgb_matrix_get_mode() != user_config.rgb_matrix_idle_mode)
|
||||
@@ -370,6 +370,7 @@ void rgb_matrix_indicators_user(void) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void rgb_matrix_update_current_mode(uint8_t mode, uint8_t speed) {
|
||||
|
@@ -24,7 +24,7 @@ static const char nav_leds[] = {38, 43, 44, 46};
|
||||
static const char fun_leds[] = {45, 44, 37, 46, 43, 38, 47, 42, 39, 40};
|
||||
static const char mouse_leds[] = {11, 16, 17, 19};
|
||||
|
||||
void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
|
||||
bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
|
||||
if (host_keyboard_led_state().caps_lock) {
|
||||
rgb_matrix_set_color(26, RGB_RED);
|
||||
}
|
||||
@@ -65,4 +65,5 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
|
||||
break;
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user