Commit abab7f16 authored by Peter Hutterer's avatar Peter Hutterer
Browse files

test: handle ABS_MT_TOOL_TYPE from the litest devices



We want to autoreplace this value where possible but not scale it to min/max,
this is effectively an enum. The same is true for slot/tracking id, so let's
add it here too.

Because it's an enum and 99% of the cases require MT_TOOL_FINGER, we always
fall back to that instead of using the axis_defaults that we use for other
axes.
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 2855e26d
......@@ -1752,7 +1752,16 @@ axis_replacement_value(struct litest_device *d,
while (axis->evcode != -1) {
if (axis->evcode == evcode) {
*value = litest_scale(d, evcode, axis->value);
switch (evcode) {
case ABS_MT_SLOT:
case ABS_MT_TRACKING_ID:
case ABS_MT_TOOL_TYPE:
*value = axis->value;
break;
default:
*value = litest_scale(d, evcode, axis->value);
break;
}
return true;
}
axis++;
......@@ -1792,6 +1801,10 @@ litest_auto_assign_value(struct litest_device *d,
case ABS_MT_DISTANCE:
value = touching ? 0 : 1;
break;
case ABS_MT_TOOL_TYPE:
if (!axis_replacement_value(d, axes, ev->code, &value))
value = MT_TOOL_FINGER;
break;
default:
if (!axis_replacement_value(d, axes, ev->code, &value) &&
d->interface->get_axis_default)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment