summaryrefslogtreecommitdiff
path: root/keyboards/ramonimbao/tkl_ff/keymaps/default
diff options
context:
space:
mode:
authorRamon Imbao <ramonimbao@gmail.com>2021-11-20 01:51:00 +0800
committerGitHub <noreply@github.com>2021-11-19 09:51:00 -0800
commit817a82378b58ec34b24a71e80f1ac0389aed9d39 (patch)
treed59feb09fce63f0b1fa083cc79ef78f10d2d2d00 /keyboards/ramonimbao/tkl_ff/keymaps/default
parent66792b0769988e845a037c5f08d05acb057d2d64 (diff)
downloadqmk_firmware-817a82378b58ec34b24a71e80f1ac0389aed9d39.tar.gz
qmk_firmware-817a82378b58ec34b24a71e80f1ac0389aed9d39.zip
[Keyboard] Add TKL-FF v2 (#15144)
Co-authored-by: Drashna Jaelre <drashna@live.com>
Diffstat (limited to 'keyboards/ramonimbao/tkl_ff/keymaps/default')
-rw-r--r--keyboards/ramonimbao/tkl_ff/keymaps/default/keymap.c39
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 1d8b938fd9..e44b56e55f 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] = {
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
)
};
+
+#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