aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/src/keymap.c
diff options
context:
space:
mode:
authorNick Conway <[email protected]>2022-05-23 16:33:08 -0400
committerPete Johanson <[email protected]>2023-04-21 21:13:31 -0700
commit3db163aa2cf7db2bd710ba93b57f3eb804b086c7 (patch)
tree3154e3d3cbb63235af8f37a9ccab76af0c78d78f /app/src/keymap.c
parent9a73650041da7008fa2df7bd8bbb02ecc8efd9b4 (diff)
downloadzmk-3db163aa2cf7db2bd710ba93b57f3eb804b086c7.tar.gz
zmk-3db163aa2cf7db2bd710ba93b57f3eb804b086c7.zip
feat(behaviors): Add reusable sensor behaviors.
* Add new sensor behaviors that either take full bindings add definition, or accept parameters when bound in the keymap. * Remove existing hard-coded key press sensor behavior and instead leverage new generic sensor behaviors to achieve the same functionality. Co-authored-by: [email protected]
Diffstat (limited to 'app/src/keymap.c')
-rw-r--r--app/src/keymap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/src/keymap.c b/app/src/keymap.c
index 1f55ad03d3..909fd20de8 100644
--- a/app/src/keymap.c
+++ b/app/src/keymap.c
@@ -270,8 +270,9 @@ int zmk_keymap_sensor_triggered(uint8_t sensor_number, const struct device *sens
continue;
}
- const uint32_t position = ZMK_VIRTUAL_KEY_POSITION_SENSOR(sensor_number);
- ret = behavior_sensor_keymap_binding_triggered(binding, sensor, position, timestamp);
+ struct zmk_behavior_binding_event event = {
+ .position = ZMK_VIRTUAL_KEY_POSITION_SENSOR(sensor_number), .timestamp = timestamp};
+ ret = behavior_sensor_keymap_binding_triggered(binding, sensor, event);
if (ret > 0) {
LOG_DBG("behavior processing to continue to next layer");