forked from kofal.net/zmk
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.
This commit is contained in:
13
app/include/zmk/events/keycode-state-changed.h
Normal file
13
app/include/zmk/events/keycode-state-changed.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <zmk/event-manager.h>
|
||||
|
||||
struct keycode_state_changed {
|
||||
struct zmk_event_header header;
|
||||
u8_t usage_page;
|
||||
u32_t keycode;
|
||||
bool state;
|
||||
};
|
||||
|
||||
ZMK_EVENT_DECLARE(keycode_state_changed);
|
||||
12
app/include/zmk/events/position-state-changed.h
Normal file
12
app/include/zmk/events/position-state-changed.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <zmk/event-manager.h>
|
||||
|
||||
struct position_state_changed {
|
||||
struct zmk_event_header header;
|
||||
u32_t position;
|
||||
bool state;
|
||||
};
|
||||
|
||||
ZMK_EVENT_DECLARE(position_state_changed);
|
||||
Reference in New Issue
Block a user