logo

qmk_firmware

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

host_led_state_reader.c (389B)


  1. #include <stdio.h>
  2. char host_led_state_str[24];
  3. const char *read_host_led_state(void)
  4. {
  5. led_t led_state = host_keyboard_led_state();
  6. snprintf(host_led_state_str, sizeof(host_led_state_str), "NL:%s CL:%s SL:%s",
  7. led_state.num_lock ? "on" : "- ",
  8. led_state.caps_lock ? "on" : "- ",
  9. led_state.scroll_lock ? "on" : "- ");
  10. return host_led_state_str;
  11. }