mirror of https://github.com/zmkfirmware/zmk.git
feat(split): Add HID indicators and physical layout set to Wired split (#3103)
This commit is contained in:
parent
4ec69cb7e6
commit
7738924349
|
|
@ -11,12 +11,17 @@
|
||||||
|
|
||||||
#include <drivers/behavior.h>
|
#include <drivers/behavior.h>
|
||||||
#include <zmk/behavior.h>
|
#include <zmk/behavior.h>
|
||||||
|
#include <zmk/physical_layouts.h>
|
||||||
|
|
||||||
#include <zmk/event_manager.h>
|
#include <zmk/event_manager.h>
|
||||||
#include <zmk/events/position_state_changed.h>
|
#include <zmk/events/position_state_changed.h>
|
||||||
#include <zmk/events/sensor_event.h>
|
#include <zmk/events/sensor_event.h>
|
||||||
#include <zmk/events/battery_state_changed.h>
|
#include <zmk/events/battery_state_changed.h>
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_ZMK_SPLIT_PERIPHERAL_HID_INDICATORS)
|
||||||
|
#include <zmk/events/hid_indicators_changed.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <zephyr/init.h>
|
#include <zephyr/init.h>
|
||||||
#include <zephyr/logging/log.h>
|
#include <zephyr/logging/log.h>
|
||||||
|
|
||||||
|
|
@ -51,6 +56,15 @@ int zmk_split_transport_peripheral_command_handler(
|
||||||
LOG_ERR("Failed to invoke behavior %s: %d", binding.behavior_dev, err);
|
LOG_ERR("Failed to invoke behavior %s: %d", binding.behavior_dev, err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
case ZMK_SPLIT_TRANSPORT_CENTRAL_CMD_TYPE_SET_PHYSICAL_LAYOUT: {
|
||||||
|
zmk_physical_layouts_select(cmd.data.set_physical_layout.layout_idx);
|
||||||
|
}
|
||||||
|
#if IS_ENABLED(CONFIG_ZMK_SPLIT_PERIPHERAL_HID_INDICATORS)
|
||||||
|
case ZMK_SPLIT_TRANSPORT_CENTRAL_CMD_TYPE_SET_HID_INDICATORS: {
|
||||||
|
raise_zmk_hid_indicators_changed((struct zmk_hid_indicators_changed){
|
||||||
|
.indicators = cmd.data.set_hid_indicators.indicators});
|
||||||
|
}
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
LOG_WRN("Unhandled command type %d", cmd.type);
|
LOG_WRN("Unhandled command type %d", cmd.type);
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue