From: Peter Hutterer Date: Thu, 11 May 2023 03:51:25 +0000 (+1000) Subject: test: add an extra override hook for tablet motion X-Git-Tag: 1.24.0~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=44de3ff3677dc03addf4aa4e4b0e835582be237e;p=platform%2Fupstream%2Flibinput.git test: add an extra override hook for tablet motion Currently unused but it complements the existing override handlers. Signed-off-by: Peter Hutterer --- diff --git a/test/litest-int.h b/test/litest-int.h index be025995..9226f574 100644 --- a/test/litest-int.h +++ b/test/litest-int.h @@ -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 diff --git a/test/litest.c b/test/litest.c index 3cad525a..175d7f42 100644 --- a/test/litest.c +++ b/test/litest.c @@ -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);