diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2022-06-27 16:38:28 +0200 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2022-06-27 16:38:28 +0200 |
commit | 98b9909429aea0869f7a6f2f44ab386a4a3ff094 (patch) | |
tree | e1080a61bb89a75edc70818489f8044adf597c48 /keyboards/crkbd/keymaps/toinux/rgb.c | |
parent | b610965fd6d851484025166fb255078b1c809261 (diff) | |
parent | fa3dd373b4925734d9843ae6014349069ffec353 (diff) | |
download | qmk_firmware-98b9909429aea0869f7a6f2f44ab386a4a3ff094.tar.gz qmk_firmware-98b9909429aea0869f7a6f2f44ab386a4a3ff094.zip |
Merge branch 'master' into taamas
Diffstat (limited to 'keyboards/crkbd/keymaps/toinux/rgb.c')
-rw-r--r-- | keyboards/crkbd/keymaps/toinux/rgb.c | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/keyboards/crkbd/keymaps/toinux/rgb.c b/keyboards/crkbd/keymaps/toinux/rgb.c new file mode 100644 index 0000000000..2c5de3b0a7 --- /dev/null +++ b/keyboards/crkbd/keymaps/toinux/rgb.c @@ -0,0 +1,68 @@ +/* Copyright 2022 @toinux + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + +#include QMK_KEYBOARD_H +#include "keycodes.h" + +static const char gaming_leds[] = {18, 22, 19, 16}; +static const char gaming2_leds[] = {23, 18, 17, 10, 9, 22, 19, 16, 11, 8}; +static const char nav_leds[] = {38, 43, 44, 46}; +static const char fun_leds[] = {45, 44, 37, 46, 43, 38, 47, 42, 39, 40}; +static const char mouse_leds[] = {11, 16, 17, 19}; + +void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + if (host_keyboard_led_state().caps_lock) { + rgb_matrix_set_color(26, RGB_RED); + } + switch(get_highest_layer(layer_state|default_layer_state)) { + case _GAMING: + if (is_keyboard_master()) { + for (uint8_t i = 0; i < 4; i++) { + rgb_matrix_set_color(gaming_leds[i], RGB_RED); + } + } + break; + case _GAMING2: + if (is_keyboard_master()) { + for (uint8_t i = 0; i < 10; i++) { + rgb_matrix_set_color(gaming2_leds[i], RGB_GREEN); + } + } + break; + case _NAV: + for (uint8_t i = 0; i < 4; i++) { + rgb_matrix_set_color(nav_leds[i], RGB_BLUE); + } + break; + case _FUN: + for (uint8_t i = 0; i < 10; i++) { + rgb_matrix_set_color(fun_leds[i], RGB_GREEN); + } + break; + case _ADJUST: + rgb_matrix_set_color(6, RGB_RED); + break; + case _MOUSE: + if (is_keyboard_master()) { + for (uint8_t i = 0; i < 4; i++) { + rgb_matrix_set_color(mouse_leds[i], RGB_PURPLE); + } + } + break; + + } +} |