fix(sensors): Handle positive or negative ticks, not just 1/-1.
This commit is contained in:
parent
d7bd81e5c4
commit
bd4a6ab095
1 changed files with 4 additions and 7 deletions
|
@ -34,15 +34,12 @@ static int on_sensor_binding_triggered(struct zmk_behavior_binding *binding,
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (value.val1) {
|
if (value.val1 > 0) {
|
||||||
case 1:
|
|
||||||
keycode = binding->param1;
|
keycode = binding->param1;
|
||||||
break;
|
} else if (value.val1 < 0) {
|
||||||
case -1:
|
|
||||||
keycode = binding->param2;
|
keycode = binding->param2;
|
||||||
break;
|
} else {
|
||||||
default:
|
return ZMK_BEHAVIOR_OPAQUE;
|
||||||
return -ENOTSUP;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_DBG("SEND %d", keycode);
|
LOG_DBG("SEND %d", keycode);
|
||||||
|
|
Loading…
Add table
Reference in a new issue