diff options
| -rw-r--r-- | keyboards/melody96/keymaps/konstantin/keymap.c | 11 | ||||
| -rw-r--r-- | users/konstantin/konstantin.c | 2 | ||||
| -rw-r--r-- | users/konstantin/rgb.c | 3 | ||||
| -rw-r--r-- | users/konstantin/rgb.h | 1 |
4 files changed, 13 insertions, 4 deletions
diff --git a/keyboards/melody96/keymaps/konstantin/keymap.c b/keyboards/melody96/keymaps/konstantin/keymap.c index 02d84d693..c8b6edb3d 100644 --- a/keyboards/melody96/keymaps/konstantin/keymap.c +++ b/keyboards/melody96/keymaps/konstantin/keymap.c | |||
| @@ -1,8 +1,12 @@ | |||
| 1 | #include QMK_KEYBOARD_H | 1 | #include QMK_KEYBOARD_H |
| 2 | #include "konstantin.h" | 2 | #include "konstantin.h" |
| 3 | 3 | ||
| 4 | static const hsv_t *colors[] = { &GODSPEED_BLUE, &GODSPEED_YELLOW }; | ||
| 5 | static size_t cnum = sizeof colors / sizeof *colors; | ||
| 6 | static size_t cidx; | ||
| 7 | |||
| 4 | void eeconfig_init_keymap(void) { | 8 | void eeconfig_init_keymap(void) { |
| 5 | rgblight_sethsv(GODSPEED_BLUE.h, GODSPEED_BLUE.s, GODSPEED_BLUE.v); | 9 | rgblight_sethsv(colors[cidx]->h, colors[cidx]->s, colors[cidx]->v); |
| 6 | } | 10 | } |
| 7 | 11 | ||
| 8 | enum keycodes_keymap { | 12 | enum keycodes_keymap { |
| @@ -12,7 +16,10 @@ enum keycodes_keymap { | |||
| 12 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | 16 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { |
| 13 | switch (keycode) { | 17 | switch (keycode) { |
| 14 | case RGB_SET: | 18 | case RGB_SET: |
| 15 | rgblight_sethsv(GODSPEED_BLUE.h, GODSPEED_BLUE.s, GODSPEED_BLUE.v); | 19 | if (record->event.pressed) { |
| 20 | cidx = (cidx + 1) % cnum; | ||
| 21 | rgblight_sethsv(colors[cidx]->h, colors[cidx]->s, colors[cidx]->v); | ||
| 22 | } | ||
| 16 | return false; | 23 | return false; |
| 17 | 24 | ||
| 18 | default: | 25 | default: |
diff --git a/users/konstantin/konstantin.c b/users/konstantin/konstantin.c index a8f2a5f2c..753742fa7 100644 --- a/users/konstantin/konstantin.c +++ b/users/konstantin/konstantin.c | |||
| @@ -61,7 +61,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 61 | return false; | 61 | return false; |
| 62 | 62 | ||
| 63 | #ifdef LAYER_FN | 63 | #ifdef LAYER_FN |
| 64 | static bool fn_lock; | 64 | static bool fn_lock; |
| 65 | 65 | ||
| 66 | case FN_FNLK: | 66 | case FN_FNLK: |
| 67 | if (record->event.pressed && record->tap.count == TAPPING_TOGGLE) { | 67 | if (record->event.pressed && record->tap.count == TAPPING_TOGGLE) { |
diff --git a/users/konstantin/rgb.c b/users/konstantin/rgb.c index b69123be0..37b1ab3d5 100644 --- a/users/konstantin/rgb.c +++ b/users/konstantin/rgb.c | |||
| @@ -1,3 +1,4 @@ | |||
| 1 | #include "rgb.h" | 1 | #include "rgb.h" |
| 2 | 2 | ||
| 3 | const hsv_t GODSPEED_BLUE = { .h = 300, .s = 68, .v = RGBLIGHT_LIMIT_VAL }; | 3 | const hsv_t GODSPEED_BLUE = { .h = 300, .s = 68, .v = RGBLIGHT_LIMIT_VAL }; |
| 4 | const hsv_t GODSPEED_YELLOW = { .h = 35, .s = 165, .v = RGBLIGHT_LIMIT_VAL }; | ||
diff --git a/users/konstantin/rgb.h b/users/konstantin/rgb.h index e296cf12e..53b5821b0 100644 --- a/users/konstantin/rgb.h +++ b/users/konstantin/rgb.h | |||
| @@ -15,3 +15,4 @@ typedef struct { | |||
| 15 | } rgb_t; | 15 | } rgb_t; |
| 16 | 16 | ||
| 17 | extern const hsv_t GODSPEED_BLUE; | 17 | extern const hsv_t GODSPEED_BLUE; |
| 18 | extern const hsv_t GODSPEED_YELLOW; | ||
