I have this weird multitouch issue on our embedded Linux product (based on Ångström). The short story is that our Qt app fails to detect TouchEnd events in certain cases when accidentally multitouching, which then "locks up" the app.
We don't need multitouch support so I've already tried to disable multitouch by editing xorg.conf
and adding:
Section "InputClass"
Identifier "NoTouch1"
MatchIsTouchscreen "on"
MatchProduct "scf0700_ts1"
Option "Ignore" "on"
EndSection
Section "InputClass"
Identifier "NoTouch2"
MatchIsTouchscreen "on"
MatchProduct "scf0700_ts2"
Option "Ignore" "on"
EndSection
and I can verify that X (xinput list) no longer "sees" more than one touch device:
xinput list
Virtual core pointer id=2 [master pointer (3)]
↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
↳ scf0700_ts0 id=8 [slave pointer (2)]
Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ twl4030_pwrbutton id=6 [slave keyboard (3)]
↳ TWL4030 Keypad id=7 [slave keyboard (3)]
Qt, however, seems to disregard this (it's using evdev instead?).
So the ugly solution to this (in my mind) is to simply prevent /dev/input/event1
and 2
from being created and letting /dev/input/event0
be the only input device (1 and 2 are the other two "touch points").
I've tried to edit the udev rules but I haven't been able to prevent the "unwanted" event devices from being created. /libs/udev/rules.d/99-xf86-input-tslib.rules before edit:
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0*,3,*a0,1,*18,*", SYMLINK+="input/touchscreen%n", ENV{x11_driver}="tslib"
and after trying to disable one of the event devices:
SUBSYSTEM=="input", KERNEL=="event1", ATTRS{name}=="scf0700_ts1", OPTIONS=="ignore_device"
Is this the right way to go? Can I do what I want using the rules or do I need to do something with the touchscreen driver instead?
I found a similar post here on SE where the solution was to use EVIOCGRAB
to grab exclusive use of the device(s). Perhaps this is another solution? Grabbing the devices and drop all events that come in?
/dev/input/event
files from being created. It may also to possible to do something in Qt, if it's using all XInput devices instead of just the core ones. Details of yourxinput
list after modification, and of your udev rule attempt would help us to figure out what went wrong. Debugging udev rules is notoriously hard, one trick is to attachstrace
toudevd
. – dirkt Feb 08 '17 at 11:35OPTIONS=="ignore_device
is even supposed to work on anything else than USB devices (my ts is i2c). – user1143242 Feb 08 '17 at 12:16evtest --grab /dev/input/eventX > /dev/null
or similar. Worth a try. – dirkt Feb 08 '17 at 14:06ignore_device
was apparently removed from udev in 2009 (release 148).I didn't realize there was a
– user1143242 Feb 08 '17 at 15:11--grab
flag forevtest
. Will try it first thing tomorrow!evtest --grab
didn't work. This seems to be a fairly new flag and my version of `evtest´ didn't support it. – user1143242 Feb 09 '17 at 14:47