diff options
Diffstat (limited to 'app/src/behaviors')
-rw-r--r-- | app/src/behaviors/behavior_key_press.c | 8 | ||||
-rw-r--r-- | app/src/behaviors/behavior_sensor_rotate_key_press.c | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/app/src/behaviors/behavior_key_press.c b/app/src/behaviors/behavior_key_press.c index bfcdbfc..8559a51 100644 --- a/app/src/behaviors/behavior_key_press.c +++ b/app/src/behaviors/behavior_key_press.c @@ -21,15 +21,15 @@ static int behavior_key_press_init(struct device *dev) { return 0; }; static int on_keymap_binding_pressed(struct zmk_behavior_binding *binding, struct zmk_behavior_binding_event event) { LOG_DBG("position %d keycode 0x%02X", event.position, binding->param1); - - return ZMK_EVENT_RAISE(keycode_state_changed_from_encoded(binding->param1, true)); + return ZMK_EVENT_RAISE( + keycode_state_changed_from_encoded(binding->param1, true, event.timestamp)); } static int on_keymap_binding_released(struct zmk_behavior_binding *binding, struct zmk_behavior_binding_event event) { LOG_DBG("position %d keycode 0x%02X", event.position, binding->param1); - - return ZMK_EVENT_RAISE(keycode_state_changed_from_encoded(binding->param1, false)); + return ZMK_EVENT_RAISE( + keycode_state_changed_from_encoded(binding->param1, false, event.timestamp)); } static const struct behavior_driver_api behavior_key_press_driver_api = { diff --git a/app/src/behaviors/behavior_sensor_rotate_key_press.c b/app/src/behaviors/behavior_sensor_rotate_key_press.c index d0a2296..199ece2 100644 --- a/app/src/behaviors/behavior_sensor_rotate_key_press.c +++ b/app/src/behaviors/behavior_sensor_rotate_key_press.c @@ -18,8 +18,8 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); static int behavior_sensor_rotate_key_press_init(struct device *dev) { return 0; }; -static int on_sensor_binding_triggered(struct zmk_behavior_binding *binding, - struct device *sensor) { +static int on_sensor_binding_triggered(struct zmk_behavior_binding *binding, struct device *sensor, + s64_t timestamp) { struct sensor_value value; int err; u32_t keycode; @@ -45,12 +45,12 @@ static int on_sensor_binding_triggered(struct zmk_behavior_binding *binding, LOG_DBG("SEND %d", keycode); - ZMK_EVENT_RAISE(keycode_state_changed_from_encoded(keycode, true)); + ZMK_EVENT_RAISE(keycode_state_changed_from_encoded(keycode, true, timestamp)); // TODO: Better way to do this? k_msleep(5); - return ZMK_EVENT_RAISE(keycode_state_changed_from_encoded(keycode, false)); + return ZMK_EVENT_RAISE(keycode_state_changed_from_encoded(keycode, false, timestamp)); } static const struct behavior_driver_api behavior_sensor_rotate_key_press_driver_api = { |