diff options
Diffstat (limited to 'keyboards/ramonimbao/tkl_ff/keymaps/default/keymap.c')
| -rw-r--r-- | keyboards/ramonimbao/tkl_ff/keymaps/default/keymap.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/keyboards/ramonimbao/tkl_ff/keymaps/default/keymap.c b/keyboards/ramonimbao/tkl_ff/keymaps/default/keymap.c index 1d8b938fd..e44b56e55 100644 --- a/keyboards/ramonimbao/tkl_ff/keymaps/default/keymap.c +++ b/keyboards/ramonimbao/tkl_ff/keymaps/default/keymap.c | |||
| @@ -25,3 +25,42 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 25 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT | 25 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT |
| 26 | ) | 26 | ) |
| 27 | }; | 27 | }; |
| 28 | |||
| 29 | #ifdef RGBLIGHT_ENABLE | ||
| 30 | const rgblight_segment_t PROGMEM ll_none[] = RGBLIGHT_LAYER_SEGMENTS( | ||
| 31 | {0, 1, HSV_OFF}, | ||
| 32 | {1, 1, HSV_OFF} | ||
| 33 | ); | ||
| 34 | |||
| 35 | const rgblight_segment_t PROGMEM ll_cl[] = RGBLIGHT_LAYER_SEGMENTS( | ||
| 36 | {1, 1, HSV_OFF} | ||
| 37 | ); | ||
| 38 | |||
| 39 | const rgblight_segment_t PROGMEM ll_sl[] = RGBLIGHT_LAYER_SEGMENTS( | ||
| 40 | {0, 1, HSV_OFF} | ||
| 41 | ); | ||
| 42 | |||
| 43 | const rgblight_segment_t* const PROGMEM rgb_layers[] = RGBLIGHT_LAYERS_LIST(ll_none, ll_cl, ll_sl); | ||
| 44 | |||
| 45 | void keyboard_post_init_kb(void) { | ||
| 46 | rgblight_layers = rgb_layers; | ||
| 47 | |||
| 48 | keyboard_post_init_user(); | ||
| 49 | } | ||
| 50 | |||
| 51 | bool led_update_kb(led_t led_state) { | ||
| 52 | bool res = led_update_user(led_state); | ||
| 53 | |||
| 54 | if (res) { | ||
| 55 | uint8_t lock_bits = led_state.scroll_lock << 1 | led_state.caps_lock; | ||
| 56 | for (uint8_t i=0; i<3; i++) { | ||
| 57 | rgblight_set_layer_state(i, false); | ||
| 58 | } | ||
| 59 | if (lock_bits < 3) { | ||
| 60 | rgblight_set_layer_state(lock_bits, true); | ||
| 61 | } | ||
| 62 | } | ||
| 63 | |||
| 64 | return res; | ||
| 65 | } | ||
| 66 | #endif | ||
