From d38740cebf3be17a7d55fc51f5f06752182f96d8 Mon Sep 17 00:00:00 2001 From: Okke Formsma Date: Sat, 10 Oct 2020 23:32:53 +0200 Subject: Add timestamps to position and behavior events (#147) * Add timestamps to position events and behaviors. - Take original event timestamps into consideration so nested tap-holds have proper timing. - Add position and timestamp to keycode state changed event so the one-shot behavior can properly identify other keypresses and timings. - Add timestamp to position events received from peripheral * reduce number of arguments to behaviors --- app/src/behaviors/behavior_rgb_underglow.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/src/behaviors/behavior_rgb_underglow.c') diff --git a/app/src/behaviors/behavior_rgb_underglow.c b/app/src/behaviors/behavior_rgb_underglow.c index 621eab5..2ee6716 100644 --- a/app/src/behaviors/behavior_rgb_underglow.c +++ b/app/src/behaviors/behavior_rgb_underglow.c @@ -12,13 +12,15 @@ #include #include +#include LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); static int behavior_rgb_underglow_init(struct device *dev) { return 0; } -static int on_keymap_binding_pressed(struct device *dev, u32_t position, u32_t action, u32_t _) { - switch (action) { +static int on_keymap_binding_pressed(struct zmk_behavior_binding *binding, + struct zmk_behavior_binding_event event) { + switch (binding->param1) { case RGB_TOG: return zmk_rgb_underglow_toggle(); case RGB_HUI: -- cgit v1.2.3