Is someone give me some example for how to toggle a layer in ACTION_FUNCTION?
I would like to change some LEDs then toggle a layer.
The follow code did not work.
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt){
static bool led = false;
switch (id) {
case TOGGLE_ARROW_LAYER:
if (led) {
gh60_esc_led_off();
}else{
gh60_esc_led_on();
led = true;
}
return (action_t) ACTION_LAYER_TOGGLE(2);
break;
}
}