Pete Johanson
5 years ago
8 changed files with 43 additions and 19 deletions
@ -0,0 +1,17 @@
@@ -0,0 +1,17 @@
|
||||
|
||||
#include "endpoints.h" |
||||
#include "usb_hid.h" |
||||
|
||||
int zmk_endpoints_send_key_event(struct zmk_key_event key_event) |
||||
{ |
||||
if (key_event.pressed) |
||||
{ |
||||
zmk_usb_hid_press_key(key_event.key); |
||||
} |
||||
else |
||||
{ |
||||
zmk_usb_hid_release_key(key_event.key); |
||||
} |
||||
|
||||
return 0; |
||||
} |
@ -0,0 +1,5 @@
@@ -0,0 +1,5 @@
|
||||
#pragma once |
||||
|
||||
#include "keys.h" |
||||
|
||||
int zmk_endpoints_send_key_event(struct zmk_key_event key_event); |
@ -1,12 +1,8 @@
@@ -1,12 +1,8 @@
|
||||
#pragma once |
||||
|
||||
#include "keymap.h" |
||||
#include <dt-bindings/zmk/keys.h> |
||||
|
||||
struct zmk_key_event |
||||
{ |
||||
zmk_key key; |
||||
bool pressed; |
||||
}; |
||||
#include "keymap.h" |
||||
#include "keys.h" |
||||
|
||||
void zmk_handle_key(struct zmk_key_event key_event); |
||||
|
@ -0,0 +1,11 @@
@@ -0,0 +1,11 @@
|
||||
#pragma once |
||||
|
||||
#include <zephyr.h> |
||||
|
||||
typedef u64_t zmk_key; |
||||
|
||||
struct zmk_key_event |
||||
{ |
||||
zmk_key key; |
||||
bool pressed; |
||||
}; |
Loading…
Reference in new issue