/* * Copyright (c) 2020 The ZMK Contributors * * SPDX-License-Identifier: MIT */ #define DT_DRV_COMPAT zmk_split_listener #include #include #include #include LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); #include #include #include #include int split_listener(const struct zmk_event_header *eh) { LOG_DBG(""); if (is_position_state_changed(eh)) { const struct position_state_changed *ev = cast_position_state_changed(eh); if (ev->state) { return zmk_split_bt_position_pressed(ev->position); } else { return zmk_split_bt_position_released(ev->position); } } return ZMK_EV_EVENT_BUBBLE; } ZMK_LISTENER(split_listener, split_listener); ZMK_SUBSCRIPTION(split_listener, position_state_changed);