summaryrefslogtreecommitdiff
path: root/keyboards/ramonimbao/tkl_ff/keymaps/via/keymap.c
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2022-06-27 16:38:28 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2022-06-27 16:38:28 +0200
commit98b9909429aea0869f7a6f2f44ab386a4a3ff094 (patch)
treee1080a61bb89a75edc70818489f8044adf597c48 /keyboards/ramonimbao/tkl_ff/keymaps/via/keymap.c
parentb610965fd6d851484025166fb255078b1c809261 (diff)
parentfa3dd373b4925734d9843ae6014349069ffec353 (diff)
downloadqmk_firmware-98b9909429aea0869f7a6f2f44ab386a4a3ff094.tar.gz
qmk_firmware-98b9909429aea0869f7a6f2f44ab386a4a3ff094.zip
Merge branch 'master' into taamas
Diffstat (limited to 'keyboards/ramonimbao/tkl_ff/keymaps/via/keymap.c')
-rw-r--r--keyboards/ramonimbao/tkl_ff/keymaps/via/keymap.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/keyboards/ramonimbao/tkl_ff/keymaps/via/keymap.c b/keyboards/ramonimbao/tkl_ff/keymaps/via/keymap.c
index d46f3aade6..298b7a1fa2 100644
--- a/keyboards/ramonimbao/tkl_ff/keymaps/via/keymap.c
+++ b/keyboards/ramonimbao/tkl_ff/keymaps/via/keymap.c
@@ -49,3 +49,42 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
)
};
+
+#ifdef RGBLIGHT_ENABLE
+const rgblight_segment_t PROGMEM ll_none[] = RGBLIGHT_LAYER_SEGMENTS(
+ {0, 1, HSV_OFF},
+ {1, 1, HSV_OFF}
+);
+
+const rgblight_segment_t PROGMEM ll_cl[] = RGBLIGHT_LAYER_SEGMENTS(
+ {1, 1, HSV_OFF}
+);
+
+const rgblight_segment_t PROGMEM ll_sl[] = RGBLIGHT_LAYER_SEGMENTS(
+ {0, 1, HSV_OFF}
+);
+
+const rgblight_segment_t* const PROGMEM rgb_layers[] = RGBLIGHT_LAYERS_LIST(ll_none, ll_cl, ll_sl);
+
+void keyboard_post_init_kb(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);
+ }
+ }
+
+ return res;
+}
+#endif