diff --git a/app/src/keymap.c b/app/src/keymap.c index 1643f647..34760ab7 100644 --- a/app/src/keymap.c +++ b/app/src/keymap.c @@ -19,8 +19,8 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); #include #include -static zmk_keymap_layers_state_t _zmk_keymap_layer_state = 0; -static uint8_t _zmk_keymap_layer_default = 0; +static const uint8_t _zmk_keymap_layer_default = 0; +static zmk_keymap_layers_state_t _zmk_keymap_layer_state = BIT(_zmk_keymap_layer_default); #define DT_DRV_COMPAT zmk_keymap @@ -87,7 +87,7 @@ static inline int set_layer_state(uint8_t layer, bool state) { zmk_keymap_layers_state_t old_state = _zmk_keymap_layer_state; WRITE_BIT(_zmk_keymap_layer_state, layer, state); // Don't send state changes unless there was an actual change - if (old_state != _zmk_keymap_layer_state) { + if (old_state != _zmk_keymap_layer_state || layer == _zmk_keymap_layer_default) { LOG_DBG("layer_changed: layer %d state %d", layer, state); ZMK_EVENT_RAISE(create_layer_state_changed(layer, state)); }