forked from kofal.net/zmk
feat(endpoints): Add endpoint select changed event.
This commit is contained in:
committed by
Pete Johanson
parent
9d34cf561e
commit
d05d7ec2d2
@@ -16,6 +16,7 @@
|
||||
#include <zmk/event_manager.h>
|
||||
#include <zmk/events/ble_active_profile_changed.h>
|
||||
#include <zmk/events/usb_conn_state_changed.h>
|
||||
#include <zmk/events/endpoint_selection_changed.h>
|
||||
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
|
||||
@@ -242,6 +243,9 @@ static void update_current_endpoint() {
|
||||
|
||||
current_endpoint = new_endpoint;
|
||||
LOG_INF("Endpoint changed: %d", current_endpoint);
|
||||
|
||||
ZMK_EVENT_RAISE(new_zmk_endpoint_selection_changed(
|
||||
(struct zmk_endpoint_selection_changed){.endpoint = current_endpoint}));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
10
app/src/events/endpoint_selection_changed.c
Normal file
10
app/src/events/endpoint_selection_changed.c
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 2021 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <kernel.h>
|
||||
#include <zmk/events/endpoint_selection_changed.h>
|
||||
|
||||
ZMK_EVENT_IMPL(zmk_endpoint_selection_changed);
|
||||
Reference in New Issue
Block a user