From 9a991bf019d6f723bc4230822852efa78a05be49 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Tue, 30 Jun 2020 00:31:09 -0400 Subject: Initial event manager work, and two first events. * Add initial event manager implementation, roughly mimicking Nordic's API. * Add `position_state_changed` and `keycode_state_changed` events. * Hook up HID and keymap to new events instead of using behaviour global event crazy. --- app/include/zmk/events/keycode-state-changed.h | 13 +++++++++++++ app/include/zmk/events/position-state-changed.h | 12 ++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 app/include/zmk/events/keycode-state-changed.h create mode 100644 app/include/zmk/events/position-state-changed.h (limited to 'app/include/zmk/events') diff --git a/app/include/zmk/events/keycode-state-changed.h b/app/include/zmk/events/keycode-state-changed.h new file mode 100644 index 0000000..48cdddc --- /dev/null +++ b/app/include/zmk/events/keycode-state-changed.h @@ -0,0 +1,13 @@ +#pragma once + +#include +#include + +struct keycode_state_changed { + struct zmk_event_header header; + u8_t usage_page; + u32_t keycode; + bool state; +}; + +ZMK_EVENT_DECLARE(keycode_state_changed); \ No newline at end of file diff --git a/app/include/zmk/events/position-state-changed.h b/app/include/zmk/events/position-state-changed.h new file mode 100644 index 0000000..190b59d --- /dev/null +++ b/app/include/zmk/events/position-state-changed.h @@ -0,0 +1,12 @@ +#pragma once + +#include +#include + +struct position_state_changed { + struct zmk_event_header header; + u32_t position; + bool state; +}; + +ZMK_EVENT_DECLARE(position_state_changed); \ No newline at end of file -- cgit v1.2.3