diff options
author | Pete Johanson <peter@peterjohanson.com> | 2020-05-22 22:47:03 -0400 |
---|---|---|
committer | Pete Johanson <peter@peterjohanson.com> | 2020-05-24 19:25:46 -0400 |
commit | 53aadc4f931a27d7b1350ea99cdc79106e138ad3 (patch) | |
tree | 2778036b5a060403b8bfd09c457c5472bf94fc6a /include/zmk | |
parent | ed5532bf94e93d25e35498cfd7a9040b0c69597b (diff) |
Initial exploration of mod tap action.
Diffstat (limited to 'include/zmk')
-rw-r--r-- | include/zmk/endpoints.h | 1 | ||||
-rw-r--r-- | include/zmk/hid.h | 4 | ||||
-rw-r--r-- | include/zmk/keys.h | 6 | ||||
-rw-r--r-- | include/zmk/kscan-mock.h | 2 |
4 files changed, 10 insertions, 3 deletions
diff --git a/include/zmk/endpoints.h b/include/zmk/endpoints.h index 42734aa..666f00d 100644 --- a/include/zmk/endpoints.h +++ b/include/zmk/endpoints.h @@ -3,4 +3,5 @@ #include <zmk/keys.h> int zmk_endpoints_init(); +int zmk_endpoints_send_report(); int zmk_endpoints_send_key_event(struct zmk_key_event key_event); diff --git a/include/zmk/hid.h b/include/zmk/hid.h index 8fbcf4f..3767b78 100644 --- a/include/zmk/hid.h +++ b/include/zmk/hid.h @@ -97,12 +97,14 @@ static const u8_t zmk_hid_report_desc[] = { struct zmk_hid_report { - u8_t modifiers; + zmk_mod_flags modifiers; u8_t keys[13]; } __packed; int zmk_hid_register_mod(zmk_mod modifier); int zmk_hid_unregister_mod(zmk_mod modifier); +int zmk_hid_register_mods(zmk_mod_flags modifiers); +int zmk_hid_unregister_mods(zmk_mod_flags modifiers); int zmk_hid_press_key(zmk_key key); int zmk_hid_release_key(zmk_key key); diff --git a/include/zmk/keys.h b/include/zmk/keys.h index be05784..6966bba 100644 --- a/include/zmk/keys.h +++ b/include/zmk/keys.h @@ -3,11 +3,15 @@ #include <zephyr.h> #include <dt-bindings/zmk/keys.h> -typedef u64_t zmk_key; +typedef u32_t zmk_key; +typedef u8_t zmk_action; typedef u8_t zmk_mod; +typedef u8_t zmk_mod_flags; struct zmk_key_event { + u32_t column; + u32_t row; zmk_key key; bool pressed; };
\ No newline at end of file diff --git a/include/zmk/kscan-mock.h b/include/zmk/kscan-mock.h index b19cafb..d481899 100644 --- a/include/zmk/kscan-mock.h +++ b/include/zmk/kscan-mock.h @@ -1,6 +1,6 @@ #pragma once -#define ZMK_MOCK_IS_PRESS(v) (v & (0x01 << 31)) +#define ZMK_MOCK_IS_PRESS(v) ((v & (0x01 << 31)) != 0) #define ZMK_MOCK_PRESS(row, col, msec) (row + (col << 8) + (msec << 16) + (0x01 << 31)) #define ZMK_MOCK_RELEASE(row, col, msec) (row + (col << 8) + (msec << 16)) #define ZMK_MOCK_ROW(v) (v & 0xFF) |