Don't expose zmk_keymap_layer_active_with_state at this time, it's not used outside of the main keymap.c code
This commit is contained in:
parent
3b1d840d2c
commit
9c49ce2e88
2 changed files with 4 additions and 5 deletions
|
@ -11,7 +11,6 @@ typedef uint32_t zmk_keymap_layers_state_t;
|
|||
uint8_t zmk_keymap_layer_default();
|
||||
zmk_keymap_layers_state_t zmk_keymap_layer_state();
|
||||
bool zmk_keymap_layer_active(uint8_t layer);
|
||||
bool zmk_keymap_layer_active_with_state(uint8_t layer, zmk_keymap_layers_state_t state_to_test);
|
||||
uint8_t zmk_keymap_highest_layer_active();
|
||||
int zmk_keymap_layer_activate(uint8_t layer);
|
||||
int zmk_keymap_layer_deactivate(uint8_t layer);
|
||||
|
|
|
@ -102,16 +102,16 @@ uint8_t zmk_keymap_layer_default() { return _zmk_keymap_layer_default; }
|
|||
|
||||
zmk_keymap_layers_state_t zmk_keymap_layer_state() { return _zmk_keymap_layer_state; }
|
||||
|
||||
bool zmk_keymap_layer_active(uint8_t layer) {
|
||||
return zmk_keymap_layer_active_with_state(layer, _zmk_keymap_layer_state);
|
||||
};
|
||||
|
||||
bool zmk_keymap_layer_active_with_state(uint8_t layer, zmk_keymap_layers_state_t state_to_test) {
|
||||
// The default layer is assumed to be ALWAYS ACTIVE so we include an || here to ensure nobody
|
||||
// breaks up that assumption by accident
|
||||
return (state_to_test & (BIT(layer))) == (BIT(layer)) || layer == _zmk_keymap_layer_default;
|
||||
};
|
||||
|
||||
bool zmk_keymap_layer_active(uint8_t layer) {
|
||||
return zmk_keymap_layer_active_with_state(layer, _zmk_keymap_layer_state);
|
||||
};
|
||||
|
||||
uint8_t zmk_keymap_highest_layer_active() {
|
||||
for (uint8_t layer = ZMK_KEYMAP_LAYERS_LEN - 1; layer > 0; layer--) {
|
||||
if (zmk_keymap_layer_active(layer)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue