From 76a433fc392be31e56df256b630a21e61775d0af Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Sun, 24 May 2020 23:13:33 -0400 Subject: Clean up and implement MT release w/o mod press. --- src/endpoints.c | 3 --- src/handlers.c | 12 ++++++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/endpoints.c b/src/endpoints.c index 3f2d576..668380a 100644 --- a/src/endpoints.c +++ b/src/endpoints.c @@ -56,9 +56,6 @@ int zmk_endpoints_send_report() int zmk_endpoints_send_key_event(struct zmk_key_event key_event) { - struct zmk_hid_report *report; - int err; - LOG_DBG("key %d, state %d\n", key_event.key, key_event.pressed); if (key_event.pressed) diff --git a/src/handlers.c b/src/handlers.c index 8c463a9..ff969b1 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -32,8 +32,16 @@ bool zmk_handle_action(zmk_action action, struct zmk_key_event *key_event) zmk_hid_unregister_mods(mods); if (action_effect_pending & BIT(flattened_index)) { - // Allow baseline keycode to flow to the endpoints! - return true; + struct zmk_key_event non_mod_event = + { + .row = key_event->row, + .column = key_event->column, + .key = ZK_KEY(key_event->key), + .pressed = true}; + + zmk_handle_key(non_mod_event); + non_mod_event.pressed = false; + zmk_handle_key(non_mod_event); } else { -- cgit v1.2.3