Sample Header Ad - 728x90

How to configure Xorg to handle a touchscreen as mouse

1 vote
0 answers
1480 views
We have a system running Linux on an industrial PC. It is based on Yocto Poky 2.5. Kernel is 4.15.30. Recently the manufacturer changed the touchscreen controller (USB based). The new one (egalax) has multitouch capability and higher resolution, none of which is needed by our application. Unfortunately, some events it sends are different from the old one, e.g. BTN_TOUCH instead of BTN_LEFT and they break our application. Changing the application or parts of it is not an option in the short term. So I am trying to devise a way to make Xorg handling the information from the touch as if it were coming from a mouse. In /dev/input, besides the event* entries, there are some mouse* ones and a mice one, which is in some way fed by the touchscreen (a cat on this mice file shows activity with both a mouse and the touch). So, I would appreciate some directions on how to configure Xorg and/or xinput to get the events from the mouse events. FWIW we are using libinput. Additional information: we had to apply a small patch to the kernel hid driver for the new panel to be recognized by Linux. Also I made a quick experiment, cross-compiled and installed kernel 5.8.16. Two devices are now reported by xinput, one of them with a "Mouse" appended to the device identification string and, according to xinput --list-props, it looks like a mouse and even have the BTN_LEFT event. But Xorg uses the touchscreen event instead. So, I would appreciate some directions and, if possible, configuration examples that would allow me to direct Xorg to handle the touch as a mouse. Alternatively, how to make it to use the Mouse event source of the touch panel, in the case of kernel 5.8. Thanks in advance for your help.
Asked by Elder Costa (11 rep)
Oct 29, 2020, 08:58 PM