1
0
Fork 0

[Keymap] Jonavin userspace keymap updates INVERT_NUMLOCK_INDICATOR (#14880)

Co-authored-by: Jonavin <=>
This commit is contained in:
jonavin 2021-10-23 02:04:08 -04:00 committed by GitHub
parent 09daafd489
commit 443d306827
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 93 additions and 25 deletions

View file

@ -89,6 +89,7 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
enum custom_rgblight_layers
{
_rgbCAPS,
_rgbNUMLOCK,
_rgbWINLOCK,
_rgbFN,
_rgbNUMPAD,
@ -98,7 +99,9 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
const rgblight_segment_t PROGMEM _rgb_capslock_layer[] = RGBLIGHT_LAYER_SEGMENTS(
{14, 1, HSV_RED} // Light 4 LEDs, starting with LED 6
);
const rgblight_segment_t PROGMEM _rgb_winlock_layer[] = RGBLIGHT_LAYER_SEGMENTS(
const rgblight_segment_t PROGMEM _rgb_numlock_layer[] = RGBLIGHT_LAYER_SEGMENTS(
{15, 1, HSV_BLUE}
); const rgblight_segment_t PROGMEM _rgb_winlock_layer[] = RGBLIGHT_LAYER_SEGMENTS(
{13, 1, HSV_PURPLE} // Light 4 LEDs, starting with LED 6
);
const rgblight_segment_t PROGMEM _rgb_fn_layer[] = RGBLIGHT_LAYER_SEGMENTS(
@ -113,6 +116,7 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
const rgblight_segment_t* const PROGMEM _rgb_layers[] = RGBLIGHT_LAYERS_LIST(
_rgb_capslock_layer,
_rgb_numlock_layer,
_rgb_winlock_layer,
_rgb_fn_layer,
_rgb_numpad_layer
@ -120,6 +124,13 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
bool led_update_user(led_t led_state) {
rgblight_set_layer_state(_rgbCAPS, led_state.caps_lock);
#ifdef INVERT_NUMLOCK_INDICATOR
rgblight_set_layer_state(_rgbNUMLOCK, !led_state.num_lock); // inverse numlock indicator override
#else
rgblight_set_layer_state(_rgbNUMLOCK, led_state.num_lock); // normal, light LED when numlock on
#endif // INVERT_NUMLOCK_INDICATOR
rgblight_set_layer_state(_rgbWINLOCK, keymap_config.no_gui);
return true;
}