Files
zmk/app/include/zmk/events/layer_state_changed.h
Nicolas Munnich 5138c6fb14 feat: Allow layer behaviors to "lock" layers on (#2717)
* refactor(core)!: Allow layer behaviors to "lock" layers on

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>

* docs: Added documentation note on locking layers

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>

---------

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2025-11-14 23:13:35 +01:00

25 lines
568 B
C

/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#pragma once
#include <zephyr/kernel.h>
#include <zmk/event_manager.h>
struct zmk_layer_state_changed {
uint8_t layer;
bool state;
bool locked;
int64_t timestamp;
};
ZMK_EVENT_DECLARE(zmk_layer_state_changed);
static inline int raise_layer_state_changed(uint8_t layer, bool state, bool locked) {
return raise_zmk_layer_state_changed((struct zmk_layer_state_changed){
.layer = layer, .state = state, .locked = locked, .timestamp = k_uptime_get()});
}