summaryrefslogtreecommitdiff
path: root/test/litest-device-protocol-a-touch-screen.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2020-01-09 09:48:29 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2020-01-29 15:58:49 +1000
commit56f1ac2b721d2b42679425e12dba9710864611ef (patch)
tree12d4fdc98d712dfba907330d16c280efc7c1dba7 /test/litest-device-protocol-a-touch-screen.c
parent8fdeba9ea22dd0bcfc77c9be6cafc8d464d93a1d (diff)
downloadlibinput-56f1ac2b721d2b42679425e12dba9710864611ef.tar.gz
test: make the custom touch override methods filter-able
Let those functions return true if they handled the event or false where they didn't. This makes it more flexible to override touches in special cases only and fall back to the normal litest handling otherwise. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'test/litest-device-protocol-a-touch-screen.c')
-rw-r--r--test/litest-device-protocol-a-touch-screen.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/litest-device-protocol-a-touch-screen.c b/test/litest-device-protocol-a-touch-screen.c
index 258955c8..3a6bfbcc 100644
--- a/test/litest-device-protocol-a-touch-screen.c
+++ b/test/litest-device-protocol-a-touch-screen.c
@@ -49,7 +49,7 @@ protocolA_create(struct litest_device *d)
return true; /* we want litest to create our device */
}
-static void
+static bool
protocolA_down(struct litest_device *d, unsigned int slot, double x, double y)
{
struct protocolA_device *dev = d->private;
@@ -90,9 +90,11 @@ protocolA_down(struct litest_device *d, unsigned int slot, double x, double y)
litest_event(d, EV_KEY, BTN_TOUCH, 1);
litest_event(d, EV_SYN, SYN_REPORT, 0);
}
+
+ return true; /* we handled the event */
}
-static void
+static bool
protocolA_move(struct litest_device *d, unsigned int slot, double x, double y)
{
struct protocolA_device *dev = d->private;
@@ -128,9 +130,11 @@ protocolA_move(struct litest_device *d, unsigned int slot, double x, double y)
if (!first)
litest_event(d, EV_SYN, SYN_REPORT, 0);
+
+ return true; /* we handled the event */
}
-static void
+static bool
protocolA_up(struct litest_device *d, unsigned int slot)
{
struct protocolA_device *dev = d->private;
@@ -166,6 +170,8 @@ protocolA_up(struct litest_device *d, unsigned int slot)
if (first)
litest_event(d, EV_KEY, BTN_TOUCH, 0);
litest_event(d, EV_SYN, SYN_REPORT, 0);
+
+ return true; /* we handled the event */
}
static struct litest_device_interface interface = {