kudox_full.c (1206B)
1 // Copyright 2021 Kumao Kobo (@kumaokobo) 2 // SPDX-License-Identifier: GPL-2.0+ 3 4 #include "quantum.h" 5 6 #ifdef OLED_ENABLE 7 bool oled_task_kb(void) { 8 if (!oled_task_user()) { return false; } 9 // Host Keyboard Layer Status 10 oled_write_ln_P(PSTR("Kudox Keyboard"), false); 11 switch (get_highest_layer(layer_state)) { 12 case 0: 13 oled_write_ln_P(PSTR("\n"), false); 14 break; 15 case 1: 16 oled_write_ln_P(PSTR("\nLayer: Symbol"), false); 17 break; 18 case 2: 19 oled_write_ln_P(PSTR("\nLayer: Function"), false); 20 break; 21 case 3: 22 oled_write_ln_P(PSTR("\nLayer: Light"), false); 23 break; 24 default: 25 // Or use the write_ln shortcut over adding '\n' to the end of your string 26 oled_write_ln_P(PSTR("\nLayer: Undefined"), false); 27 } 28 // Host Keyboard LED Status 29 led_t led_state = host_keyboard_led_state(); 30 oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); 31 oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); 32 oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); 33 return true; 34 } 35 #endif