summaryrefslogtreecommitdiffstats
path: root/keyboards/crkbd/keymaps/lib/host_led_state_reader.c
blob: c19af11f8a98a3d528b1c14dab30da9851a8e6bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "crkbd.h"

char host_led_state[40];

char *read_host_led_state(void)
{
  snprintf(host_led_state, sizeof(host_led_state), "\n%s  %s  %s",
           (host_keyboard_leds() & (1 << USB_LED_NUM_LOCK)) ? "NUMLOCK" : "       ",
           (host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK)) ? "CAPS" : "    ",
           (host_keyboard_leds() & (1 << USB_LED_SCROLL_LOCK)) ? "SCLK" : "    ");

  return host_led_state;
}