2018-06-01 11:11:06 +06:00
|
|
|
#include "drashna.h"
|
|
|
|
#include "rgb_stuff.h"
|
2018-07-17 07:04:32 +06:00
|
|
|
#include "eeprom.h"
|
2018-06-01 11:11:06 +06:00
|
|
|
|
|
|
|
extern rgblight_config_t rgblight_config;
|
2019-07-23 09:22:33 +06:00
|
|
|
bool has_initialized;
|
2018-06-01 11:11:06 +06:00
|
|
|
|
2019-07-23 09:22:33 +06:00
|
|
|
void rgblight_sethsv_default_helper(uint8_t index) { rgblight_sethsv_at(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, index); }
|
2019-09-07 21:57:30 +06:00
|
|
|
|
|
|
|
/* Custom indicators for modifiers.
|
|
|
|
* This allows for certain lights to be lit up, based on what mods are active, giving some visual feedback.
|
|
|
|
* This is especially useful for One Shot Mods, since it's not always obvious if they're still lit up.
|
|
|
|
*/
|
2020-04-01 05:26:43 +06:00
|
|
|
#ifdef INDICATOR_LIGHTS
|
2018-06-01 11:11:06 +06:00
|
|
|
void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) {
|
2019-11-21 02:37:24 +06:00
|
|
|
if (userspace_config.rgb_layer_change && get_highest_layer(layer_state) == 0) {
|
2019-07-23 09:22:33 +06:00
|
|
|
if ((this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1 << USB_LED_CAPS_LOCK)) {
|
2020-04-01 05:26:43 +06:00
|
|
|
# ifdef SHFT_LED1
|
2019-05-07 11:34:09 +06:00
|
|
|
rgblight_sethsv_at(120, 255, 255, SHFT_LED1);
|
2020-04-01 05:26:43 +06:00
|
|
|
# endif // SHFT_LED1
|
|
|
|
# ifdef SHFT_LED2
|
2019-05-07 11:34:09 +06:00
|
|
|
rgblight_sethsv_at(120, 255, 255, SHFT_LED2);
|
2020-04-01 05:26:43 +06:00
|
|
|
# endif // SHFT_LED2
|
2019-05-07 11:34:09 +06:00
|
|
|
} else {
|
2020-04-01 05:26:43 +06:00
|
|
|
# ifdef SHFT_LED1
|
2019-05-07 11:34:09 +06:00
|
|
|
rgblight_sethsv_default_helper(SHFT_LED1);
|
2020-04-01 05:26:43 +06:00
|
|
|
# endif // SHFT_LED1
|
|
|
|
# ifdef SHFT_LED2
|
2019-05-07 11:34:09 +06:00
|
|
|
rgblight_sethsv_default_helper(SHFT_LED2);
|
2020-04-01 05:26:43 +06:00
|
|
|
# endif // SHFT_LED2
|
2019-05-07 11:34:09 +06:00
|
|
|
}
|
2019-07-23 09:22:33 +06:00
|
|
|
if ((this_mod | this_osm) & MOD_MASK_CTRL) {
|
2020-04-01 05:26:43 +06:00
|
|
|
# ifdef CTRL_LED1
|
2019-05-07 11:34:09 +06:00
|
|
|
rgblight_sethsv_at(0, 255, 255, CTRL_LED1);
|
2020-04-01 05:26:43 +06:00
|
|
|
# endif // CTRL_LED1
|
|
|
|
# ifdef CTRL_LED2
|
2019-05-07 11:34:09 +06:00
|
|
|
rgblight_sethsv_at(0, 255, 255, CTRL_LED2);
|
2020-04-01 05:26:43 +06:00
|
|
|
# endif // CTRL_LED2
|
2019-05-07 11:34:09 +06:00
|
|
|
} else {
|
2020-04-01 05:26:43 +06:00
|
|
|
# ifdef CTRL_LED1
|
2019-05-07 11:34:09 +06:00
|
|
|
rgblight_sethsv_default_helper(CTRL_LED1);
|
2020-04-01 05:26:43 +06:00
|
|
|
# endif // CTRL_LED1
|
|
|
|
# ifdef CTRL_LED2
|
2019-05-07 11:34:09 +06:00
|
|
|
rgblight_sethsv_default_helper(CTRL_LED2);
|
2020-04-01 05:26:43 +06:00
|
|
|
# endif // CTRL_LED2
|
2019-05-07 11:34:09 +06:00
|
|
|
}
|
2019-07-23 09:22:33 +06:00
|
|
|
if ((this_mod | this_osm) & MOD_MASK_GUI) {
|
2020-04-01 05:26:43 +06:00
|
|
|
# ifdef GUI_LED1
|
2019-05-07 11:34:09 +06:00
|
|
|
rgblight_sethsv_at(51, 255, 255, GUI_LED1);
|
2020-04-01 05:26:43 +06:00
|
|
|
# endif // GUI_LED1
|
|
|
|
# ifdef GUI_LED2
|
2019-05-07 11:34:09 +06:00
|
|
|
rgblight_sethsv_at(51, 255, 255, GUI_LED2);
|
2020-04-01 05:26:43 +06:00
|
|
|
# endif // GUI_LED2
|
2019-05-07 11:34:09 +06:00
|
|
|
} else {
|
2020-04-01 05:26:43 +06:00
|
|
|
# ifdef GUI_LED1
|
2019-05-07 11:34:09 +06:00
|
|
|
rgblight_sethsv_default_helper(GUI_LED1);
|
2020-04-01 05:26:43 +06:00
|
|
|
# endif // GUI_LED1
|
|
|
|
# ifdef GUI_LED2
|
2019-05-07 11:34:09 +06:00
|
|
|
rgblight_sethsv_default_helper(GUI_LED2);
|
2020-04-01 05:26:43 +06:00
|
|
|
# endif // GUI_LED2
|
2019-05-07 11:34:09 +06:00
|
|
|
}
|
2019-07-23 09:22:33 +06:00
|
|
|
if ((this_mod | this_osm) & MOD_MASK_ALT) {
|
2020-04-01 05:26:43 +06:00
|
|
|
# ifdef ALT_LED1
|
2019-05-07 11:34:09 +06:00
|
|
|
rgblight_sethsv_at(240, 255, 255, ALT_LED1);
|
2020-04-01 05:26:43 +06:00
|
|
|
# endif // ALT_LED1
|
|
|
|
# ifdef GUI_LED2
|
2019-05-07 11:34:09 +06:00
|
|
|
rgblight_sethsv_at(240, 255, 255, ALT_LED2);
|
2020-04-01 05:26:43 +06:00
|
|
|
# endif // GUI_LED2
|
2019-05-07 11:34:09 +06:00
|
|
|
} else {
|
2020-04-01 05:26:43 +06:00
|
|
|
# ifdef GUI_LED1
|
2019-05-07 11:34:09 +06:00
|
|
|
rgblight_sethsv_default_helper(ALT_LED1);
|
2020-04-01 05:26:43 +06:00
|
|
|
# endif // GUI_LED1
|
|
|
|
# ifdef GUI_LED2
|
2019-05-07 11:34:09 +06:00
|
|
|
rgblight_sethsv_default_helper(ALT_LED2);
|
2020-04-01 05:26:43 +06:00
|
|
|
# endif // GUI_LED2
|
2019-05-07 11:34:09 +06:00
|
|
|
}
|
2018-06-01 11:11:06 +06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-07 21:57:30 +06:00
|
|
|
/* Function for the indicators */
|
2018-06-01 11:11:06 +06:00
|
|
|
void matrix_scan_indicator(void) {
|
2019-05-07 11:34:09 +06:00
|
|
|
if (has_initialized) {
|
|
|
|
set_rgb_indicators(get_mods(), host_keyboard_leds(), get_oneshot_mods());
|
|
|
|
}
|
2018-06-01 11:11:06 +06:00
|
|
|
}
|
2020-04-01 05:26:43 +06:00
|
|
|
#endif // INDICATOR_LIGHTS
|
2018-06-01 11:11:06 +06:00
|
|
|
|
2020-04-01 05:26:43 +06:00
|
|
|
#ifdef RGBLIGHT_TWINKLE
|
2018-06-01 11:11:06 +06:00
|
|
|
static rgblight_fadeout lights[RGBLED_NUM];
|
|
|
|
|
2019-07-23 09:22:33 +06:00
|
|
|
__attribute__((weak)) bool rgblight_twinkle_is_led_used_keymap(uint8_t index) { return false; }
|
2018-07-17 07:04:32 +06:00
|
|
|
|
2019-09-07 21:57:30 +06:00
|
|
|
/* This function checks for used LEDs. This way, collisions don't occur and cause weird rendering */
|
2018-07-17 07:04:32 +06:00
|
|
|
bool rgblight_twinkle_is_led_used(uint8_t index) {
|
2019-05-07 11:34:09 +06:00
|
|
|
switch (index) {
|
2020-04-01 05:26:43 +06:00
|
|
|
# ifdef INDICATOR_LIGHTS
|
|
|
|
# ifdef SHFT_LED1
|
2019-05-07 11:34:09 +06:00
|
|
|
case SHFT_LED1:
|
|
|
|
return true;
|
2020-04-01 05:26:43 +06:00
|
|
|
# endif // SHFT_LED1
|
|
|
|
# ifdef SHFT_LED2
|
2019-05-07 11:34:09 +06:00
|
|
|
case SHFT_LED2:
|
|
|
|
return true;
|
2020-04-01 05:26:43 +06:00
|
|
|
# endif // SHFT_LED2
|
|
|
|
# ifdef CTRL_LED1
|
2019-05-07 11:34:09 +06:00
|
|
|
case CTRL_LED1:
|
|
|
|
return true;
|
2020-04-01 05:26:43 +06:00
|
|
|
# endif // CTRL_LED1
|
|
|
|
# ifdef CTRL_LED2
|
2019-05-07 11:34:09 +06:00
|
|
|
case CTRL_LED2:
|
|
|
|
return true;
|
2020-04-01 05:26:43 +06:00
|
|
|
# endif // CTRL_LED2
|
|
|
|
# ifdef GUI_LED1
|
2019-05-07 11:34:09 +06:00
|
|
|
case GUI_LED1:
|
|
|
|
return true;
|
2020-04-01 05:26:43 +06:00
|
|
|
# endif // GUI_LED1
|
|
|
|
# ifdef GUI_LED2
|
2019-05-07 11:34:09 +06:00
|
|
|
case GUI_LED2:
|
|
|
|
return true;
|
2020-04-01 05:26:43 +06:00
|
|
|
# endif // GUI_LED2
|
|
|
|
# ifdef ALT_LED1
|
2019-05-07 11:34:09 +06:00
|
|
|
case ALT_LED1:
|
|
|
|
return true;
|
2020-04-01 05:26:43 +06:00
|
|
|
# endif // ALT_LED1
|
|
|
|
# ifdef ALT_LED2
|
2019-05-07 11:34:09 +06:00
|
|
|
case ALT_LED2:
|
|
|
|
return true;
|
2020-04-01 05:26:43 +06:00
|
|
|
# endif // ALT_LED2
|
|
|
|
# endif // INDICATOR_LIGHTS
|
2019-05-07 11:34:09 +06:00
|
|
|
default:
|
|
|
|
return rgblight_twinkle_is_led_used_keymap(index);
|
2019-07-23 09:22:33 +06:00
|
|
|
}
|
2018-07-17 07:04:32 +06:00
|
|
|
}
|
2018-06-01 11:11:06 +06:00
|
|
|
|
2019-09-07 21:57:30 +06:00
|
|
|
/* Handler for fading/twinkling effect */
|
2019-07-23 09:22:33 +06:00
|
|
|
void scan_rgblight_fadeout(void) { // Don't effing change this function .... rgblight_sethsv is supppppper intensive
|
2019-05-07 11:34:09 +06:00
|
|
|
bool litup = false;
|
2020-01-06 15:49:49 +06:00
|
|
|
|
2019-07-23 09:22:33 +06:00
|
|
|
for (uint8_t light_index = 0; light_index < RGBLED_NUM; ++light_index) {
|
2019-05-07 11:34:09 +06:00
|
|
|
if (lights[light_index].enabled && timer_elapsed(lights[light_index].timer) > 10) {
|
2019-07-23 09:22:33 +06:00
|
|
|
rgblight_fadeout *light = &lights[light_index];
|
|
|
|
litup = true;
|
2018-06-01 11:11:06 +06:00
|
|
|
|
2019-07-23 09:22:33 +06:00
|
|
|
if (light->life) {
|
|
|
|
light->life -= 1;
|
2019-11-21 02:37:24 +06:00
|
|
|
if (get_highest_layer(layer_state) == 0) {
|
2019-07-23 09:22:33 +06:00
|
|
|
sethsv(light->hue + rand() % 0xF, 255, light->life, (LED_TYPE *)&led[light_index]);
|
|
|
|
}
|
|
|
|
light->timer = timer_read();
|
|
|
|
} else {
|
2019-11-21 02:37:24 +06:00
|
|
|
if (light->enabled && get_highest_layer(layer_state) == 0) {
|
2019-07-23 09:22:33 +06:00
|
|
|
rgblight_sethsv_default_helper(light_index);
|
|
|
|
}
|
|
|
|
litup = light->enabled = false;
|
2019-05-07 11:34:09 +06:00
|
|
|
}
|
2018-06-01 11:11:06 +06:00
|
|
|
}
|
|
|
|
}
|
2019-11-21 02:37:24 +06:00
|
|
|
if (litup && get_highest_layer(layer_state) == 0) {
|
2019-05-07 11:34:09 +06:00
|
|
|
rgblight_set();
|
|
|
|
}
|
2018-06-01 11:11:06 +06:00
|
|
|
}
|
|
|
|
|
2019-09-07 21:57:30 +06:00
|
|
|
/* Triggers a LED to fade/twinkle.
|
|
|
|
* This function handles the selection of the LED and prepres for it to be used.
|
|
|
|
*/
|
2018-06-01 11:11:06 +06:00
|
|
|
void start_rgb_light(void) {
|
|
|
|
uint8_t indices[RGBLED_NUM];
|
2019-07-23 09:22:33 +06:00
|
|
|
uint8_t indices_count = 0;
|
|
|
|
uint8_t min_life = 0xFF;
|
2018-06-01 11:11:06 +06:00
|
|
|
uint8_t min_life_index = -1;
|
2020-01-06 15:49:49 +06:00
|
|
|
|
2019-07-23 09:22:33 +06:00
|
|
|
for (uint8_t index = 0; index < RGBLED_NUM; ++index) {
|
|
|
|
if (rgblight_twinkle_is_led_used(index)) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (lights[index].enabled) {
|
|
|
|
if (min_life_index == -1 || lights[index].life < min_life) {
|
|
|
|
min_life = lights[index].life;
|
|
|
|
min_life_index = index;
|
|
|
|
}
|
|
|
|
continue;
|
2018-06-01 11:11:06 +06:00
|
|
|
}
|
|
|
|
|
2019-07-23 09:22:33 +06:00
|
|
|
indices[indices_count] = index;
|
|
|
|
++indices_count;
|
2018-06-01 11:11:06 +06:00
|
|
|
}
|
|
|
|
|
|
|
|
uint8_t light_index;
|
|
|
|
if (!indices_count) {
|
|
|
|
light_index = min_life_index;
|
2019-07-23 09:22:33 +06:00
|
|
|
} else {
|
|
|
|
light_index = indices[rand() % indices_count];
|
2018-06-01 11:11:06 +06:00
|
|
|
}
|
|
|
|
|
|
|
|
rgblight_fadeout *light = &lights[light_index];
|
2019-07-23 09:22:33 +06:00
|
|
|
light->enabled = true;
|
|
|
|
light->timer = timer_read();
|
|
|
|
light->life = 0xC0 + rand() % 0x40;
|
2018-06-01 11:11:06 +06:00
|
|
|
|
|
|
|
light->hue = rgblight_config.hue + (rand() % 0xB4) - 0x54;
|
|
|
|
|
|
|
|
rgblight_sethsv_at(light->hue, 255, light->life, light_index);
|
|
|
|
}
|
2020-04-01 05:26:43 +06:00
|
|
|
#endif
|
2018-06-01 11:11:06 +06:00
|
|
|
|
2020-04-01 05:26:43 +06:00
|
|
|
bool process_record_user_rgb_light(uint16_t keycode, keyrecord_t *record) {
|
2019-09-07 21:57:30 +06:00
|
|
|
uint16_t temp_keycode = keycode;
|
|
|
|
// Filter out the actual keycode from MT and LT keys.
|
2019-05-07 11:34:09 +06:00
|
|
|
if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) {
|
2019-09-07 21:57:30 +06:00
|
|
|
temp_keycode &= 0xFF;
|
2019-05-07 11:34:09 +06:00
|
|
|
}
|
2019-09-07 21:57:30 +06:00
|
|
|
|
|
|
|
switch (temp_keycode) {
|
2018-06-01 11:11:06 +06:00
|
|
|
#ifdef RGBLIGHT_TWINKLE
|
2019-05-07 11:34:09 +06:00
|
|
|
case KC_A ... KC_SLASH:
|
|
|
|
case KC_F1 ... KC_F12:
|
|
|
|
case KC_INSERT ... KC_UP:
|
|
|
|
case KC_KP_SLASH ... KC_KP_DOT:
|
|
|
|
case KC_F13 ... KC_F24:
|
|
|
|
case KC_AUDIO_MUTE ... KC_MEDIA_REWIND:
|
2019-07-23 09:22:33 +06:00
|
|
|
if (record->event.pressed) {
|
|
|
|
start_rgb_light();
|
|
|
|
}
|
|
|
|
break;
|
2020-04-01 05:26:43 +06:00
|
|
|
#endif // RGBLIGHT_TWINKLE
|
2019-07-23 09:22:33 +06:00
|
|
|
}
|
2018-06-01 11:11:06 +06:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-04-01 05:26:43 +06:00
|
|
|
void keyboard_post_init_rgb_light(void) {
|
|
|
|
#if defined(RGBLIGHT_STARTUP_ANIMATION)
|
2019-07-23 09:22:33 +06:00
|
|
|
bool is_enabled = rgblight_config.enable;
|
|
|
|
if (userspace_config.rgb_layer_change) {
|
|
|
|
rgblight_enable_noeeprom();
|
|
|
|
}
|
2019-05-07 11:34:09 +06:00
|
|
|
if (rgblight_config.enable) {
|
2020-04-01 05:26:43 +06:00
|
|
|
layer_state_set_rgb_light(layer_state);
|
2019-05-07 11:34:09 +06:00
|
|
|
uint16_t old_hue = rgblight_config.hue;
|
|
|
|
rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
|
|
|
|
for (uint16_t i = 255; i > 0; i--) {
|
2019-07-23 09:22:33 +06:00
|
|
|
rgblight_sethsv_noeeprom((i + old_hue) % 255, 255, 255);
|
2019-05-07 11:34:09 +06:00
|
|
|
matrix_scan();
|
|
|
|
wait_ms(10);
|
|
|
|
}
|
2019-04-23 00:55:55 +06:00
|
|
|
}
|
2019-07-23 09:22:33 +06:00
|
|
|
if (!is_enabled) {
|
|
|
|
rgblight_disable_noeeprom();
|
|
|
|
}
|
|
|
|
|
2019-09-07 21:57:30 +06:00
|
|
|
#endif
|
2020-04-01 05:26:43 +06:00
|
|
|
layer_state_set_rgb_light(layer_state);
|
2019-02-17 08:28:04 +06:00
|
|
|
}
|
2018-06-01 11:11:06 +06:00
|
|
|
|
2020-04-01 05:26:43 +06:00
|
|
|
void matrix_scan_rgb_light(void) {
|
2019-09-07 21:57:30 +06:00
|
|
|
#ifdef RGBLIGHT_ENABLE
|
|
|
|
# ifdef RGBLIGHT_TWINKLE
|
2019-05-07 11:34:09 +06:00
|
|
|
scan_rgblight_fadeout();
|
2019-09-07 21:57:30 +06:00
|
|
|
# endif // RGBLIGHT_ENABLE
|
2018-06-01 11:11:06 +06:00
|
|
|
|
2019-09-07 21:57:30 +06:00
|
|
|
# ifdef INDICATOR_LIGHTS
|
2019-05-07 11:34:09 +06:00
|
|
|
matrix_scan_indicator();
|
2019-09-07 21:57:30 +06:00
|
|
|
# endif
|
|
|
|
#endif
|
2018-06-01 11:11:06 +06:00
|
|
|
}
|
|
|
|
|
2019-11-21 02:37:24 +06:00
|
|
|
void rgblight_set_hsv_and_mode(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode) {
|
|
|
|
rgblight_sethsv_noeeprom(hue, sat, val);
|
|
|
|
wait_us(175); // Add a slight delay between color and mode to ensure it's processed correctly
|
|
|
|
rgblight_mode_noeeprom(mode);
|
|
|
|
}
|
|
|
|
|
2020-04-01 05:26:43 +06:00
|
|
|
layer_state_t layer_state_set_rgb_light(layer_state_t state) {
|
2018-06-01 11:11:06 +06:00
|
|
|
#ifdef RGBLIGHT_ENABLE
|
2019-05-07 11:34:09 +06:00
|
|
|
if (userspace_config.rgb_layer_change) {
|
2019-11-21 02:37:24 +06:00
|
|
|
switch (get_highest_layer(state)) {
|
2019-05-07 11:34:09 +06:00
|
|
|
case _MACROS:
|
2019-11-21 02:37:24 +06:00
|
|
|
rgblight_set_hsv_and_mode(HSV_ORANGE, userspace_config.is_overwatch ? RGBLIGHT_MODE_SNAKE + 2 : RGBLIGHT_MODE_SNAKE + 3);
|
2019-05-07 11:34:09 +06:00
|
|
|
break;
|
|
|
|
case _MEDIA:
|
2019-11-21 02:37:24 +06:00
|
|
|
rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_KNIGHT + 1);
|
2019-05-07 11:34:09 +06:00
|
|
|
break;
|
|
|
|
case _GAMEPAD:
|
2019-11-21 02:37:24 +06:00
|
|
|
rgblight_set_hsv_and_mode(HSV_ORANGE, RGBLIGHT_MODE_SNAKE + 2);
|
2019-05-07 11:34:09 +06:00
|
|
|
break;
|
|
|
|
case _DIABLO:
|
2019-11-21 02:37:24 +06:00
|
|
|
rgblight_set_hsv_and_mode(HSV_RED, RGBLIGHT_MODE_BREATHING + 3);
|
2019-05-07 11:34:09 +06:00
|
|
|
break;
|
|
|
|
case _RAISE:
|
2019-11-21 02:37:24 +06:00
|
|
|
rgblight_set_hsv_and_mode(HSV_YELLOW, RGBLIGHT_MODE_BREATHING + 3);
|
2019-05-07 11:34:09 +06:00
|
|
|
break;
|
|
|
|
case _LOWER:
|
2019-11-21 02:37:24 +06:00
|
|
|
rgblight_set_hsv_and_mode(HSV_GREEN, RGBLIGHT_MODE_BREATHING + 3);
|
2019-05-07 11:34:09 +06:00
|
|
|
break;
|
|
|
|
case _ADJUST:
|
2019-11-21 02:37:24 +06:00
|
|
|
rgblight_set_hsv_and_mode(HSV_RED, RGBLIGHT_MODE_KNIGHT + 2);
|
2019-05-07 11:34:09 +06:00
|
|
|
break;
|
2019-07-23 09:22:33 +06:00
|
|
|
default: // for any other layers, or the default layer
|
2019-11-21 02:37:24 +06:00
|
|
|
{
|
|
|
|
uint8_t mode = get_highest_layer(state) == _MODS ? RGBLIGHT_MODE_BREATHING : RGBLIGHT_MODE_STATIC_LIGHT;
|
|
|
|
switch (get_highest_layer(default_layer_state)) {
|
2019-05-07 11:34:09 +06:00
|
|
|
case _COLEMAK:
|
2019-11-21 02:37:24 +06:00
|
|
|
rgblight_set_hsv_and_mode(HSV_MAGENTA, mode);
|
2019-07-23 09:22:33 +06:00
|
|
|
break;
|
2019-05-07 11:34:09 +06:00
|
|
|
case _DVORAK:
|
2019-11-21 02:37:24 +06:00
|
|
|
rgblight_set_hsv_and_mode(HSV_SPRINGGREEN, mode);
|
2019-07-23 09:22:33 +06:00
|
|
|
break;
|
2019-05-07 11:34:09 +06:00
|
|
|
case _WORKMAN:
|
2019-11-21 02:37:24 +06:00
|
|
|
rgblight_set_hsv_and_mode(HSV_GOLDENROD, mode);
|
2019-07-23 09:22:33 +06:00
|
|
|
break;
|
2019-05-07 11:34:09 +06:00
|
|
|
case _NORMAN:
|
2019-11-21 02:37:24 +06:00
|
|
|
rgblight_set_hsv_and_mode(HSV_CORAL, mode);
|
2019-07-23 09:22:33 +06:00
|
|
|
break;
|
2019-05-07 11:34:09 +06:00
|
|
|
case _MALTRON:
|
2019-11-21 02:37:24 +06:00
|
|
|
rgblight_set_hsv_and_mode(HSV_YELLOW, mode);
|
2019-07-23 09:22:33 +06:00
|
|
|
break;
|
2019-05-07 11:34:09 +06:00
|
|
|
case _EUCALYN:
|
2019-11-21 02:37:24 +06:00
|
|
|
rgblight_set_hsv_and_mode(HSV_PINK, mode);
|
2019-07-23 09:22:33 +06:00
|
|
|
break;
|
2019-05-07 11:34:09 +06:00
|
|
|
case _CARPLAX:
|
2019-11-21 02:37:24 +06:00
|
|
|
rgblight_set_hsv_and_mode(HSV_BLUE, mode);
|
2019-07-23 09:22:33 +06:00
|
|
|
break;
|
2019-05-07 11:34:09 +06:00
|
|
|
default:
|
2019-11-21 02:37:24 +06:00
|
|
|
rgblight_set_hsv_and_mode(HSV_CYAN, mode);
|
2019-07-23 09:22:33 +06:00
|
|
|
break;
|
2019-05-07 11:34:09 +06:00
|
|
|
}
|
|
|
|
break;
|
2019-11-21 02:37:24 +06:00
|
|
|
}
|
2019-05-07 11:34:09 +06:00
|
|
|
}
|
2018-06-01 11:11:06 +06:00
|
|
|
}
|
2019-07-23 09:22:33 +06:00
|
|
|
#endif // RGBLIGHT_ENABLE
|
2018-06-01 11:11:06 +06:00
|
|
|
|
2019-05-07 11:34:09 +06:00
|
|
|
return state;
|
2018-11-27 06:45:24 +06:00
|
|
|
}
|