test: add an extra override hook for tablet motion

Currently unused but it complements the existing override handlers.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2023-05-11 13:51:25 +10:00
parent 160b062454
commit 44de3ff367
2 changed files with 9 additions and 0 deletions

View file

@ -125,6 +125,9 @@ struct litest_device_interface {
bool (*tablet_tip_up)(struct litest_device *d,
double *x, double *y,
struct axis_replacement *axes);
bool (*tablet_motion)(struct litest_device *d,
double *x, double *y,
struct axis_replacement *axes);
/**
* Pad events, LITEST_AUTO_ASSIGN is allowed on event values

View file

@ -2536,6 +2536,12 @@ litest_tablet_motion(struct litest_device *d,
{
struct input_event *ev;
/* If the test device overrides proximity_out and says it didn't
* handle the event, let's continue normally */
if (d->interface->tablet_motion &&
d->interface->tablet_motion(d, &x, &y, axes))
return;
ev = d->interface->tablet_motion_events;
while (ev && (int16_t)ev->type != -1 && (int16_t)ev->code != -1) {
int value = auto_assign_tablet_value(d, ev, x, y, axes);