aboutsummaryrefslogtreecommitdiff
path: root/keyboards
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards')
-rw-r--r--keyboards/kbdfans/kbd6x/keymaps/konstantin/config.h1
-rw-r--r--keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c42
-rw-r--r--keyboards/kbdfans/kbd6x/keymaps/konstantin/rules.mk22
-rw-r--r--keyboards/melody96/keymaps/konstantin/keymap.c2
-rw-r--r--keyboards/melody96/keymaps/konstantin/rules.mk21
-rw-r--r--keyboards/wasdat/keymaps/konstantin/rules.mk18
-rw-r--r--keyboards/whitefox/keymaps/konstantin/rules.mk22
7 files changed, 85 insertions, 43 deletions
diff --git a/keyboards/kbdfans/kbd6x/keymaps/konstantin/config.h b/keyboards/kbdfans/kbd6x/keymaps/konstantin/config.h
index 16387fa2f..4b511eb84 100644
--- a/keyboards/kbdfans/kbd6x/keymaps/konstantin/config.h
+++ b/keyboards/kbdfans/kbd6x/keymaps/konstantin/config.h
@@ -1,4 +1,3 @@
1#pragma once 1#pragma once
2 2
3#define LAYER_FN 3#define LAYER_FN
4#define SEND_STRING_CLEAN
diff --git a/keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c b/keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c
index b348b0b7b..c5c8c0963 100644
--- a/keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c
+++ b/keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c
@@ -10,7 +10,7 @@ enum layers_keymap {
10}; 10};
11 11
12void eeconfig_init_keymap(void) { 12void eeconfig_init_keymap(void) {
13 rgblight_sethsv(MODERN_DOLCH_RED.h, MODERN_DOLCH_RED.s, MODERN_DOLCH_RED.v); 13 rgblight_sethsv(MODERN_DOLCH_RED);
14 rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL); 14 rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL);
15} 15}
16 16
@@ -31,6 +31,46 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
31 } 31 }
32} 32}
33 33
34static bool skip_caps = false;
35
36static void fn_light(uint32_t state) {
37 if (IS_LAYER_ON_STATE(state, L_FN)) {
38 rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
39 rgblight_sethsv_noeeprom(modern_dolch_red.h, modern_dolch_red.s, rgblight_get_val());
40 skip_caps = true;
41 } else {
42 rgblight_config_t saved = { .raw = eeconfig_read_rgblight() };
43 rgblight_sethsv_noeeprom(saved.hue, saved.sat, saved.val);
44 rgblight_mode_noeeprom(saved.mode);
45 }
46 // caps_light will be called automatically after this
47}
48
49static void caps_light(uint8_t usb_led) {
50 if (skip_caps) {
51 skip_caps = false;
52 return; // Skip calls triggered by the Fn layer turning on
53 }
54 if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
55 rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
56 rgblight_sethsv_noeeprom(modern_dolch_cyan.h, modern_dolch_cyan.s, rgblight_get_val());
57 } else {
58 fn_light(layer_state); // Caps is off, check if Fn light should be on
59 }
60}
61
62uint32_t layer_state_set_keymap(uint32_t state) {
63 static uint32_t prev_state = L_BASE;
64 if (IS_LAYER_ON_STATE(state, L_FN) != IS_LAYER_ON_STATE(prev_state, L_FN)) {
65 fn_light(state); // Fn state changed since last time
66 }
67 return prev_state = state;
68}
69
70void led_set_keymap(uint8_t usb_led) {
71 caps_light(usb_led);
72}
73
34const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 74const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
35 /* Base layer 75 /* Base layer
36 * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ 76 * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
diff --git a/keyboards/kbdfans/kbd6x/keymaps/konstantin/rules.mk b/keyboards/kbdfans/kbd6x/keymaps/konstantin/rules.mk
index f7cf0758b..7262c6db6 100644
--- a/keyboards/kbdfans/kbd6x/keymaps/konstantin/rules.mk
+++ b/keyboards/kbdfans/kbd6x/keymaps/konstantin/rules.mk
@@ -1,11 +1,11 @@
1BOOTMAGIC_ENABLE = no 1BACKLIGHT_ENABLE = no
2COMMAND_ENABLE = yes 2BOOTMAGIC_ENABLE = no
3CONSOLE_ENABLE = no 3COMMAND_ENABLE = yes
4EXTRAKEY_ENABLE = yes 4CONSOLE_ENABLE = yes
5MOUSEKEY_ENABLE = yes 5EXTRAKEY_ENABLE = yes
6NKRO_ENABLE = yes 6MOUSEKEY_ENABLE = yes
7TAP_DANCE_ENABLE = yes 7NKRO_ENABLE = yes
8UNICODEMAP_ENABLE = no 8RGBLIGHT_ENABLE = yes
9 9SPACE_CADET_ENABLE = no
10BACKLIGHT_ENABLE = yes 10TAP_DANCE_ENABLE = yes
11RGBLIGHT_ENABLE = yes 11UNICODEMAP_ENABLE = no
diff --git a/keyboards/melody96/keymaps/konstantin/keymap.c b/keyboards/melody96/keymaps/konstantin/keymap.c
index c2b043104..e02ba0f85 100644
--- a/keyboards/melody96/keymaps/konstantin/keymap.c
+++ b/keyboards/melody96/keymaps/konstantin/keymap.c
@@ -1,7 +1,7 @@
1#include QMK_KEYBOARD_H 1#include QMK_KEYBOARD_H
2#include "konstantin.h" 2#include "konstantin.h"
3 3
4static const HSV *colors[] = { &GODSPEED_BLUE, &GODSPEED_YELLOW }; 4static const HSV *colors[] = { &godspeed_blue, &godspeed_yellow };
5static const size_t cnum = sizeof colors / sizeof *colors; 5static const size_t cnum = sizeof colors / sizeof *colors;
6static size_t cidx = 0; 6static size_t cidx = 0;
7 7
diff --git a/keyboards/melody96/keymaps/konstantin/rules.mk b/keyboards/melody96/keymaps/konstantin/rules.mk
index 47a859d08..995402cb0 100644
--- a/keyboards/melody96/keymaps/konstantin/rules.mk
+++ b/keyboards/melody96/keymaps/konstantin/rules.mk
@@ -1,10 +1,11 @@
1BOOTMAGIC_ENABLE = no 1BACKLIGHT_ENABLE = no
2COMMAND_ENABLE = yes 2BOOTMAGIC_ENABLE = no
3CONSOLE_ENABLE = no 3COMMAND_ENABLE = yes
4EXTRAKEY_ENABLE = yes 4CONSOLE_ENABLE = no
5MOUSEKEY_ENABLE = yes 5EXTRAKEY_ENABLE = yes
6NKRO_ENABLE = yes 6MOUSEKEY_ENABLE = yes
7TAP_DANCE_ENABLE = yes 7NKRO_ENABLE = yes
8UNICODEMAP_ENABLE = yes 8RGBLIGHT_ENABLE = yes
9 9SPACE_CADET_ENABLE = no
10BACKLIGHT_ENABLE = no 10TAP_DANCE_ENABLE = yes
11UNICODEMAP_ENABLE = yes
diff --git a/keyboards/wasdat/keymaps/konstantin/rules.mk b/keyboards/wasdat/keymaps/konstantin/rules.mk
index 4bb1ee658..041d32114 100644
--- a/keyboards/wasdat/keymaps/konstantin/rules.mk
+++ b/keyboards/wasdat/keymaps/konstantin/rules.mk
@@ -1,8 +1,10 @@
1BOOTMAGIC_ENABLE = no 1BACKLIGHT_ENABLE = no
2COMMAND_ENABLE = yes 2BOOTMAGIC_ENABLE = no
3CONSOLE_ENABLE = yes 3COMMAND_ENABLE = yes
4EXTRAKEY_ENABLE = yes 4CONSOLE_ENABLE = yes
5MOUSEKEY_ENABLE = yes 5EXTRAKEY_ENABLE = yes
6NKRO_ENABLE = yes 6MOUSEKEY_ENABLE = yes
7TAP_DANCE_ENABLE = yes 7NKRO_ENABLE = yes
8UNICODEMAP_ENABLE = yes 8SPACE_CADET_ENABLE = no
9TAP_DANCE_ENABLE = yes
10UNICODEMAP_ENABLE = yes
diff --git a/keyboards/whitefox/keymaps/konstantin/rules.mk b/keyboards/whitefox/keymaps/konstantin/rules.mk
index 625ef346c..bced6e8a7 100644
--- a/keyboards/whitefox/keymaps/konstantin/rules.mk
+++ b/keyboards/whitefox/keymaps/konstantin/rules.mk
@@ -1,11 +1,11 @@
1BOOTMAGIC_ENABLE = no 1BACKLIGHT_ENABLE = no
2COMMAND_ENABLE = yes 2BOOTMAGIC_ENABLE = no
3CONSOLE_ENABLE = yes 3COMMAND_ENABLE = yes
4EXTRAKEY_ENABLE = yes 4CONSOLE_ENABLE = yes
5MOUSEKEY_ENABLE = yes 5EXTRAKEY_ENABLE = yes
6NKRO_ENABLE = yes 6MOUSEKEY_ENABLE = yes
7TAP_DANCE_ENABLE = yes 7NKRO_ENABLE = yes
8UNICODEMAP_ENABLE = yes 8SPACE_CADET_ENABLE = no
9 9TAP_DANCE_ENABLE = yes
10BACKLIGHT_ENABLE = no 10UNICODEMAP_ENABLE = yes
11VISUALIZER_ENABLE = no 11VISUALIZER_ENABLE = no