5 __attribute__((weak)) void matrix_init_keymap(void) {}
7 __attribute__((weak)) void matrix_scan_keymap(void) {}
9 __attribute__((weak)) bool process_record_keymap(uint16_t keycode,
10 keyrecord_t *record) {
14 __attribute__((weak)) void led_set_keymap(uint8_t usb_led) {}
16 static uint8_t c_lyr = 0; // current layer.
18 bool shifted_layer(void) {
19 static bool is_shifted = false;
23 register_code(KC_LSFT);
29 unregister_code(KC_LSFT);
38 void matrix_init_user(void) {
39 eeprom_read_led_dim_lvl();
44 void matrix_scan_user(void) {
45 static uint8_t is_leds_changes = 1;
46 c_lyr = biton32(layer_state);
48 is_leds_changes = is_leds_changes << set_layer_led(c_lyr);
49 is_leds_changes = is_leds_changes << shifted_layer();
50 is_leds_changes = is_leds_changes << rainbow_loop(c_lyr);
52 if (is_leds_changes > 1) {
60 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
61 set_key_led(record, c_lyr);
63 if (led_brightness(keycode, record)) {
69 return process_record_keymap(keycode, record);
72 void led_set_user(uint8_t usb_led) {
73 if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
74 rbw_led_keys[RBW_LCAP].status = ENABLED;
75 rbw_led_keys[RBW_RCAP].status = ENABLED;
77 rbw_led_keys[RBW_LCAP].status = DISABLED;
78 rbw_led_keys[RBW_RCAP].status = DISABLED;
81 if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
82 rbw_led_keys[RBW_SCRL].status = ENABLED;
84 rbw_led_keys[RBW_SCRL].status = DISABLED;
87 led_set_keymap(usb_led);