mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-04 04:40:25 +01:00
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 <peter.hutterer@who-t.net>
This commit is contained in:
parent
2855e26d6f
commit
abab7f1609
1 changed files with 14 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue