forked from kofal.net/zmk
feat: Split physical layout selection sync.
* Ensure the split peripherals have the same selected physical layout on connection and change.
This commit is contained in:
committed by
Pete Johanson
parent
f992352936
commit
33e3b02ddb
@@ -22,6 +22,8 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
|
||||
#include <zmk/event_manager.h>
|
||||
#include <zmk/events/position_state_changed.h>
|
||||
|
||||
ZMK_EVENT_IMPL(zmk_physical_layout_selection_changed);
|
||||
|
||||
#define DT_DRV_COMPAT zmk_physical_layout
|
||||
|
||||
#define USE_PHY_LAYOUTS \
|
||||
@@ -247,7 +249,14 @@ int zmk_physical_layouts_select(uint8_t index) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return zmk_physical_layouts_select_layout(layouts[index]);
|
||||
int ret = zmk_physical_layouts_select_layout(layouts[index]);
|
||||
|
||||
if (ret >= 0) {
|
||||
raise_zmk_physical_layout_selection_changed(
|
||||
(struct zmk_physical_layout_selection_changed){.selection = index});
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int zmk_physical_layouts_get_selected(void) {
|
||||
|
||||
Reference in New Issue
Block a user