diff options
author | Okke Formsma <okke@formsma.nl> | 2020-11-11 22:06:25 +0100 |
---|---|---|
committer | Pete Johanson <peter@peterjohanson.com> | 2020-11-28 00:58:24 -0500 |
commit | bee45f9b3a2217dd5df4ee940becb951e3e1e13a (patch) | |
tree | 5a66f7006e53d041deab1c9fa044a2ed8c6df2d0 /app/include/drivers/behavior.h | |
parent | 27d036b9d5e40e05dc4809ad1ccb3255d414d267 (diff) |
feat(events): add timestamp to keycode_state_changed and sensor_event
These timestamps are necessary to correctly deal with delayed events due to hold-tap shenanigans.
Diffstat (limited to 'app/include/drivers/behavior.h')
-rw-r--r-- | app/include/drivers/behavior.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/include/drivers/behavior.h b/app/include/drivers/behavior.h index cf259b1..39561a2 100644 --- a/app/include/drivers/behavior.h +++ b/app/include/drivers/behavior.h @@ -23,7 +23,7 @@ typedef int (*behavior_keymap_binding_callback_t)(struct zmk_behavior_binding *binding, struct zmk_behavior_binding_event event); typedef int (*behavior_sensor_keymap_binding_callback_t)(struct zmk_behavior_binding *binding, - struct device *sensor); + struct device *sensor, s64_t timestamp); __subsystem struct behavior_driver_api { behavior_keymap_binding_callback_t binding_pressed; @@ -92,11 +92,11 @@ static inline int z_impl_behavior_keymap_binding_released(struct zmk_behavior_bi * @retval Negative errno code if failure. */ __syscall int behavior_sensor_keymap_binding_triggered(struct zmk_behavior_binding *binding, - struct device *sensor); + struct device *sensor, s64_t timestamp); static inline int z_impl_behavior_sensor_keymap_binding_triggered(struct zmk_behavior_binding *binding, - struct device *sensor) { + struct device *sensor, s64_t timestamp) { struct device *dev = device_get_binding(binding->behavior_dev); const struct behavior_driver_api *api = (const struct behavior_driver_api *)dev->driver_api; @@ -104,7 +104,7 @@ z_impl_behavior_sensor_keymap_binding_triggered(struct zmk_behavior_binding *bin return -ENOTSUP; } - return api->sensor_binding_triggered(binding, sensor); + return api->sensor_binding_triggered(binding, sensor, timestamp); } /** |