libts / tslib

Touchscreen access library
GNU Lesser General Public License v2.1
625 stars 292 forks source link

plugins: input-raw: Parse BTN_LEFT in MT mode #218

Open dsemkowicz-tt opened 9 months ago

dsemkowicz-tt commented 9 months ago

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.

dsemkowicz-tt commented 1 month ago

Hello @merge, Are there any obstacles to merging this change into master?

merge commented 1 month ago

I'm not sure about whether we can or should do this by default. as part of a hardware-quirk, it would be ok for sure

dsemkowicz-tt commented 1 month ago

If I understand the code correctly, the same behaviour is already implemented for single touch: https://github.com/libts/tslib/blob/master/plugins/input-raw.c#L373.

Regarding a hardware-quirk approach, do you mean to implement the fix in the Linux kernel or tslib?

merge commented 1 month ago

true, but ts_read() is really a different API

I mean if you'd detect your device in get_special_device() ( and #define YOUR_DEVICE 3) and say sth like


case BTN_LEFT
    if (i->special_device != YOUR_DEVICE)
        continue;

(just as an idea), we could definitely merge that

dsemkowicz-tt commented 1 month ago

Ok, I will try to change implementation.