From c99ec9e08c2ef698b41e921b8ba5f2c0ff6b2aa9 Mon Sep 17 00:00:00 2001 From: Daniel Semkowicz Date: Fri, 12 Jan 2024 13:26:10 +0100 Subject: [PATCH] plugins: input-raw: Parse BTN_LEFT in MT mode Some devices, like eGalax USB HID touch panel, emulate a mouse device. In such case, BTN_LEFT instead of BTN_TOUCH event is read from evdev input. This case is already covered in `ts_input_read()`, but not in the `ts_input_read_mt()`. As `ts_uinput` tool always uses multitouch mode, such devices do not register touch events correctly. Handle BTN_LEFT in the same way as BTN_TOUCH is handled to fix this problem. This will now be common with `ts_input_read()` implementation. Signed-off-by: Daniel Semkowicz --- plugins/input-raw.c | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/input-raw.c b/plugins/input-raw.c index 0e8a22f..63ccae3 100644 --- a/plugins/input-raw.c +++ b/plugins/input-raw.c @@ -657,6 +657,7 @@ static int ts_input_read_mt(struct tslib_module_info *inf, case EV_KEY: switch (i->ev[it].code) { case BTN_TOUCH: + case BTN_LEFT: i->buf[total][i->slot].pen_down = i->ev[it].value; i->buf[total][i->slot].tv.tv_sec = i->ev[it].input_event_sec; i->buf[total][i->slot].tv.tv_usec = i->ev[it].input_event_usec;