logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

kudox_full.c (1206B)


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