[Interest] TUIO (multi-touch) Input Plugin

Rick Stockton rickstockton at reno-computerhelp.com
Wed Mar 6 20:49:19 CET 2013


Shawn is correct, that Qt5 DOES NOT Support multiple pointers in
concurrent use. Qt 5.x (and earlier) have made a very fundamental choice
at design time (of Qt itself): A GUI Application cannot be working
(concurrently) with more than one Pointer Device.

There is a "Pointer Focus", which is conceptually almost the same as
"Keyboard Focus." But, because Mouse (and Touchpad) devices provide us
with location information (via "Move" Events), Qt automatically moves
the Focus for you: Focus occurs on the Widget (or Element) which is
under the Pointer's location. When another kind of Mouse Event occurs,
if that Widget/Element does not accept and handle the Event, then it
will be passed to the Element's parent, and finally to the
QGuiApplication itself. That is the only "focusPolicy", and it works
very well (IMO). When you have a need to somehow "Pass a Mouse Event
Differently", you do that using Signal/Slot, or by accepting then Event
in an event Filter, and then sending an entirely new Mouse Event to the
desired Widget.

This is automatic, and there are no Pointer Methods analogous to
setFocus() for Keyboards Devices. With Keyboards, you need a focus
policy to move between widgets/elements. And quite often, you do need to
explicitly setFocus() for the Keyboard - because the Policy doesn't go
where you want it to, or takes too many steps to get there. The
important thing to keep in mind is: There is only ONE pointer Device,
and it actually DOES have a "focus" property.  Although Xi 2.x can
support concurrent Pointers,  Multiple Pointers in the same Qt
Application, e.g. a Game of "Pong" with two mice playing in the same Gui
Window, would require some relatively big API changes. Such changes will
never be supported in Qt5. (Although this could perhaps be a feature in
a new Qt Major Release.)

On 03/06/2013 06:26 AM, Rutledge Shawn wrote:
> On 6 Mar 2013, at 2:38 PM, Casimiro, Daniel C CIV NUWC NWPT wrote:
> Hi,
>
> I wrote a input plugin for Qt 5 that parses TUIO. I think that it is pretty useful. The code is available on github at:
>
> https://github.com/dancasimiro/qtuiotouch
>
> Documentation:
> The documentation is sparse, but the code is based on the multi-touch input plugin that is shipped with Qt.
>
> Testing:
> My plugin has only been tested on Red Hat Enterprise Linux 6. I am using multi-touch hardware from Perceptive Pixel and the TUIO server distributed with their drivers.
>
> Dependencies:
> - Qt 5
> - Boost ASIO
>
> Known bugs:
> - I want to improve the latency in tracking fingers in Qt Quick 2 applications
> - The plugin must be manually loaded by passing "-plugin TuioTouch" to your application
> That sounds like fun.  
>
> I think we don't support multi-pointer X, but if you have a big touch table and multiple users, it's a similar scenario.  So I suppose you can drag and pinch multiple items at once, but cannot give keyboard focus to multiple items at once, right?
>
> Is it possible that xinput 2.2 could work with this hardware, if someone wrote the X driver for it?  Because we already support that kind of multi-point touch without any plugins.  But maybe the tagged objects are too special, not ordinary touch points.
>
> Can you tell more about your application to use this? 




More information about the Interest mailing list