From 44de3ff3677dc03addf4aa4e4b0e835582be237e Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 11 May 2023 13:51:25 +1000 Subject: [PATCH] test: add an extra override hook for tablet motion Currently unused but it complements the existing override handlers. Signed-off-by: Peter Hutterer --- test/litest-int.h | 3 +++ test/litest.c | 6 ++++++ 2 files changed, 9 insertions(+) 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); -- 2.34.1