2 Copyright 2017 Fred Sundvik
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #include "simple_visualizer.h"
20 // This function should be implemented by the keymap visualizer
21 // Don't change anything else than state->target_lcd_color and state->layer_text as that's the only thing
22 // that the simple_visualizer assumes that you are updating
23 // Also make sure that the buffer passed to state->layer_text remains valid until the previous animation is
24 // stopped. This can be done by either double buffering it or by using constant strings
25 static void get_visualizer_layer_and_color(visualizer_state_t* state) {
27 if (state->status.layer & 0x20) {
29 state->target_lcd_color = LCD_COLOR(85, 255, 128);
30 state->layer_text = "Gaming";
32 else if (state->status.layer & 0x10) {
34 state->target_lcd_color = LCD_COLOR(28, 255, 230);
35 state->layer_text = "Numpad & Mouse";
37 else if (state->status.layer & 0x8) {
39 state->target_lcd_color = LCD_COLOR(38, 255, 230);
40 state->layer_text = "Symbols";
42 else if (state->status.layer & 0x4) {
44 state->target_lcd_color = LCD_COLOR(0, 255, 95);
45 if (state->status.layer & 0x2){
46 state->layer_text = "Qwerty - Fn";
48 state->layer_text = "Colemak - Fn";
51 else if (state->status.layer & 0x2) {
53 state->target_lcd_color = LCD_COLOR(149, 255, 192);
54 state->layer_text = "Qwerty";
58 state->target_lcd_color = LCD_COLOR(200, 255, 192);
59 state->layer_text = "Colemak";