[Interest] Does Qt5 support multiple touch devices for X Window?

Rutledge Shawn Shawn.Rutledge at digia.com
Wed Oct 30 11:06:46 CET 2013

On 29 Oct 2013, at 8:09 AM, Leslie Zhai wrote:

> Hi qt developers && users,
> Does Qt5 support multiple touch devices for X Window?
> For example, 9 projected capacitive touch screen devices experienced as a super big touch screen, shown as below link: 
> https://raw.github.com/xiangzhai/myblog/master/MTX11-Note/mtm.jpg
> When I touched the FIRST screen, X Window rendered the mouse in the FIRST monitor, but touched the second or others, X Window still rendered it in the FIRST monitor, X Window fail to transform the coordinate matrix.
> I sent an email to xorg-devel http://lists.x.org/archives/xorg-devel/2013-October/038263.html and a nice people named Peter gave me some advice about XSetWacom http://sourceforge.net/apps/mediawiki/linuxwacom/index.php?title=Dual_and_Multi-Monitor_Set_Up

That should be fixable.  E.g. I have the following in /etc/X11/xorg.conf.d/52-acer-touchscreen-options.conf:

Section "InputClass"
	Identifier "Acer touchscreen options"
	MatchProduct "Advanced Silicon S.A CoolTouch(TM) System"
	MatchDevicePath "/dev/input/event*"
	Option "Transformation Matrix" "0.5 0 0.5 0 0.9 0 0 0 1"

It's not a very agile configuration obviously, but I always have this monitor to the right of my main one, so this conf file sets the transformation matrix.  (I wonder if it could be automatic some day, because X should realize which monitor has which touch device.)  But I suppose you will need something more unique to identify your 9 devices and set different matrices on each; ideally a serial number or or something.  Or if you know that the /dev/input/eventX device doesn't change? but then it depends which USB port you plug it into, doesn't it?

Qt uses XInput 2.2 to detect and use multi-touch devices, so if you get it working in X and your drivers provide correct XInput multitouch events, it should work in Qt applications.  You can also use one of the non-Qt multitouch testing programs to check.

> But I prefer to use read /dev/input/eventX file descriptor based on Linux Multi-Touch Protocol B https://www.kernel.org/doc/Documentation/input/multi-touch-protocol.txt
> And handled multiply touch devices simultaneously, when got ABS_MT_POSITION_X and ABS_MT_POSITION_Y, transformed the corrdinate based on the touch device (Monitor) logical position https://raw.github.com/xiangzhai/myblog/master/MTX11-Note/MT.conf

Well there is the plugin in src/plugins/generic/evdevtouch which has its own README and is mainly intended for non-X11 embedded systems.  It should be possible to load multiple instances for multiple devices (not that I've tried!) but that won't solve the transformation problem.  I wonder if the kernel touchscreen driver could do it; but I don't think that's the standard way.

But what's wrong with using XInput?

More information about the Interest mailing list