From df2759706fc83e9cedc8c9101f9e94e9c9a00682 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 11 Sep 2020 08:43:58 +1000 Subject: test: auto-assign the tool type for tablet tests The current tool type test merely sends BTN_TOOL_RUBBER (and others) manually and expects libinput to do the right thing. This only tests the perfect sequence but not test weird devices that behave differently on a tool type switch. So let's fix this by setting the tool type as property on the libinput test device itself, and then emulate the tool switch through litest. For special devices this will need extra callbacks, this is just the initial framework to handle those buttons. Signed-off-by: Peter Hutterer --- test/litest-int.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/litest-int.h') diff --git a/test/litest-int.h b/test/litest-int.h index c5b05e68..5bc62d9c 100644 --- a/test/litest-int.h +++ b/test/litest-int.h @@ -31,6 +31,9 @@ /* Use as designater for litest to change the value */ #define LITEST_AUTO_ASSIGN INT_MIN +/* Special event code to auto-assign the BTN_TOOL_PEN and friends */ +#define LITEST_BTN_TOOL_AUTO (KEY_MAX << 1) + struct litest_test_device { struct list node; /* global test device list */ @@ -129,6 +132,8 @@ struct litest_device_interface { int min[2]; /* x/y axis minimum */ int max[2]; /* x/y axis maximum */ + + unsigned int tool_type; }; struct path { -- cgit v1.2.3