From 02bffb009f0c5815209e6a477777d95d72574df2 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Mon, 11 May 2020 14:42:59 -0400 Subject: [PATCH] Pass pointer to event to user handler. * Allow user functions to modify/update the event if they need to. --- src/handlers.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/handlers.c b/src/handlers.c index 5eb1b512..7c329c50 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -3,17 +3,18 @@ #include "usb_hid.h" -__attribute__((weak)) bool zmk_handle_key_user(struct zmk_key_event key_event) +__attribute__((weak)) bool zmk_handle_key_user(struct zmk_key_event *key_event) { return true; }; void zmk_handle_key(struct zmk_key_event key_event) { - if (!zmk_handle_key_user(key_event)) + if (!zmk_handle_key_user(&key_event)) { return; } + if (key_event.pressed) { zmk_usb_hid_press_key(key_event.key);