mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-12 02:10:20 +01:00
test: allow overriding any axis value
Previously test devices had to set LITEST_AUTO_ASSIGN to be able to override an axis-specific value. But this prevented us from easily overriding other axis values (e.g. tablet tool ids) that usually have the same value. LITEST_AUTO_ASSIGN should indicate a value that must always be auto-assigned, that makes a lot more sense. This does mean we need to handle ABS_MT_TRACKING_ID -1 to avoid that getting overwritten by auto_assign_tablet_value() but oh well. Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1398>
This commit is contained in:
parent
c8e0312195
commit
ef1ee837e4
1 changed files with 8 additions and 2 deletions
|
|
@ -2885,7 +2885,7 @@ auto_assign_tablet_value(struct litest_device *d,
|
|||
static int tracking_id;
|
||||
int value = ev->value;
|
||||
|
||||
if (value != LITEST_AUTO_ASSIGN || ev->type != EV_ABS)
|
||||
if (ev->type != EV_ABS)
|
||||
return value;
|
||||
|
||||
switch (ev->code) {
|
||||
|
|
@ -2902,7 +2902,7 @@ auto_assign_tablet_value(struct litest_device *d,
|
|||
break;
|
||||
default:
|
||||
if (!axis_replacement_value(d, axes, ev->code, &value) &&
|
||||
d->interface->get_axis_default) {
|
||||
value == LITEST_AUTO_ASSIGN && d->interface->get_axis_default) {
|
||||
int error = d->interface->get_axis_default(d, ev->code, &value);
|
||||
if (error) {
|
||||
litest_abort_msg(
|
||||
|
|
@ -3000,6 +3000,12 @@ litest_tablet_proximity_out(struct litest_device *d)
|
|||
case evbit(EV_KEY, LITEST_BTN_TOOL_AUTO):
|
||||
litest_tool_event(d, ev->value);
|
||||
break;
|
||||
case evbit(EV_ABS, ABS_MT_TRACKING_ID):
|
||||
if (ev->value == -1) {
|
||||
litest_event(d, ev->type, ev->code, ev->value);
|
||||
break;
|
||||
}
|
||||
_fallthrough_;
|
||||
default:
|
||||
value = auto_assign_tablet_value(d, ev, 0, 0, NULL);
|
||||
if (!tablet_ignore_event(ev, value))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue