Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tslib: read from all suitable input devices?

Tags:

qt

touchscreen

Is there some way to use a touchscreen without explicitely specifying the exact input device?

Let me explain in depth...

My host has a number of input devices:

$ ls -al /dev/input/
drwxr-xr-x    2 root     root          200 Jul 11 16:09 .
drwxr-xr-x   11 root     root         4580 Jul 10 15:31 ..
crw-rw-rw-    1 root     root      13,  64 Jan  1  1970 event0
crw-rw-rw-    1 root     root      13,  65 Jan  1  1970 event1
crw-rw-rw-    1 root     root      13,  66 Jan  1  1970 event2
crw-rw-rw-    1 root     root      13,  95 Jan  1  1970 event99
crw-rw----    1 root     root      13,  63 Jan  1  1970 mice
crw-rw----    1 root     root      10, 223 Jan  1  1970 uinput

One of these input devices (usually event2) is the touchscreen thats connected via USB. My problem is that...

  • the eventX device might not always be event2
  • the touchscreen might be unplugged and plugged in again (that will result in a different eventX device) and the touchscreen should work again without needing to restart the application
  • the USB host might occasionally do a reset (because of other problems) resulting in a USB disconnect and USB reconnect of the touchscreen

The application is a Qt embedded 4.7 application running in full screen mode, using tslib as touchscreen driver.

For another project with similar issues I already wrote a little daemon (I called it "eventbundler") that reads data from all /dev/input/eventX devices and sends the data to a named pipe (FIFO). However, tslib won't accept that fifo as input device (QWS_MOUSE_PROTO=tslib:/dev/input/eventbundler-mouse) - probably because the IOCTLs to query the device capabilities don't work (it says "selected device is not a touchscreen I understand").

Anyway what I'd need is that tslib should somehow autodetect the touchscreen device and read from it even if had been unplugged for a moment.

Any hints?

I'm willing to alter the Qt source code if that is of any help.

like image 955
Udo G Avatar asked May 01 '26 23:05

Udo G


1 Answers

This is no solution, but there's an issue for tslib that very vaguely describes your problem. If ideas regarding path selection are discussed there, it at least might help to solve this someday.

like image 155
merge Avatar answered May 06 '26 07:05

merge



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!