added a function to get the number of layers.

This commit is contained in:
SpaceComet 2022-10-02 03:32:02 +00:00
parent fa0fccdbf5
commit 58897e29a5
2 changed files with 5 additions and 0 deletions

View file

@ -14,6 +14,7 @@ uint8_t zmk_keymap_layer_default();
zmk_keymap_layers_state_t zmk_keymap_layer_state();
bool zmk_keymap_layer_active(uint8_t layer);
uint8_t zmk_keymap_highest_layer_active();
uint8_t zmk_keymap_number_of_layers();
int zmk_keymap_layer_activate(uint8_t layer);
int zmk_keymap_layer_deactivate(uint8_t layer);
int zmk_keymap_layer_toggle(uint8_t layer);

View file

@ -124,6 +124,10 @@ uint8_t zmk_keymap_highest_layer_active() {
return zmk_keymap_layer_default();
}
uint8_t zmk_keymap_number_of_layers() {
return ZMK_KEYMAP_LAYERS_LEN;
}
int zmk_keymap_layer_activate(uint8_t layer) { return set_layer_state(layer, true); };
int zmk_keymap_layer_deactivate(uint8_t layer) { return set_layer_state(layer, false); };