I was able to make it work, but it might not be the cleanest. I am new to coding
bool my_led_status = 1;
hook_layer_change(uint32_t layer_state)
{
if (my_led_status);
if (layer_state & (1L<<1)) {
// LED is off, so let's turn it on
led_set(host_keyboard_leds() | (1<<USB_LED_NUM_LOCK));
my_led_status = 1;
} else {
// LED is on, so let's turn it off
led_set(host_keyboard_leds() & ~(1<<USB_LED_NUM_LOCK));
my_led_status = 0;
}
}
hook_keyboard_leds_change(uint8_t led_status)
{
if (my_led_status)
{
// LED is off, so let's turn it on
led_set(host_keyboard_leds() | (1<<USB_LED_NUM_LOCK));
my_led_status = 1;
}
else
{
// LED is on, so let's turn it off
led_set(host_keyboard_leds() & ~(1<<USB_LED_NUM_LOCK));
my_led_status = 0;
}
}
hook_late_init(void)
{
if (my_led_status)
{
led_set(host_keyboard_leds() & ~(1<<USB_LED_NUM_LOCK));
my_led_status = 0;
}
}