mirror of https://github.com/zmkfirmware/zmk.git
feat(pointing): Allow peripheral input processing to stop propagation (#2844)
Allow peripheral input processors to prevent event propagation to centrals. --------- Co-authored-by: Pete Johanson <peter@peterjohanson.com>
This commit is contained in:
parent
eb99b4ede0
commit
462d48b78e
|
|
@ -56,8 +56,12 @@ int zmk_input_split_report_peripheral_event(uint8_t reg, uint8_t type, uint16_t
|
||||||
"Peripheral input splits need an `input` property set"); \
|
"Peripheral input splits need an `input` property set"); \
|
||||||
void split_input_handler_##n(struct input_event *evt) { \
|
void split_input_handler_##n(struct input_event *evt) { \
|
||||||
for (size_t i = 0; i < ARRAY_SIZE(processors_##n); i++) { \
|
for (size_t i = 0; i < ARRAY_SIZE(processors_##n); i++) { \
|
||||||
zmk_input_processor_handle_event(processors_##n[i].dev, evt, processors_##n[i].param1, \
|
int ret = zmk_input_processor_handle_event(processors_##n[i].dev, evt, \
|
||||||
processors_##n[i].param2, NULL); \
|
processors_##n[i].param1, \
|
||||||
|
processors_##n[i].param2, NULL); \
|
||||||
|
if (ret != ZMK_INPUT_PROC_CONTINUE) { \
|
||||||
|
return; \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
struct zmk_split_transport_peripheral_event ev = { \
|
struct zmk_split_transport_peripheral_event ev = { \
|
||||||
.type = ZMK_SPLIT_TRANSPORT_PERIPHERAL_EVENT_TYPE_INPUT_EVENT, \
|
.type = ZMK_SPLIT_TRANSPORT_PERIPHERAL_EVENT_TYPE_INPUT_EVENT, \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue