feat(behaviors): Add key position to key events

Extended the virtual key position system from combos so that each sensor
also gets a virtual key position. This allows sensor behaviors to use
the behavior queue API.
This commit is contained in:
Joel Spadin
2022-10-29 23:17:12 -05:00
committed by Pete Johanson
parent 83a151890c
commit e7a6e4016d
6 changed files with 44 additions and 12 deletions

View File

@@ -21,7 +21,8 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
static int behavior_sensor_rotate_key_press_init(const struct device *dev) { return 0; };
static int on_sensor_binding_triggered(struct zmk_behavior_binding *binding,
const struct device *sensor, int64_t timestamp) {
const struct device *sensor, uint32_t virtual_key_position,
int64_t timestamp) {
struct sensor_value value;
int err;
uint32_t keycode;