Keeping in touch…

Posted by Bradley T. Hughes on May 22, 2009 · 20 comments

(pun intended)

So, it’s been a while since my original blog on touch support in Qt, so I thought I would provide an update on what’s been going on in that area.

Code

Simon was so gracious to start mirroring the clone Denis and I made to add gesture and touch support to Qt. This clone includes the gesture API that Denis has been working on as well. At the moment, Windows 7 is the only operating system out there that provides a multi-point touch API for to build on-top of, so multi-point touch only works on Windows 7 at the moment. We’re investigating how to support other platforms as well as 3rd party multi-point touch solutions. I’m hoping that someone out there with experience in this area can help us integrate support for these systems.

Behavioral Change

In my last blog, I asked the question “what about touch events that affect multiple widgets or QGraphicsItems?” The answer I gave at the time was the easiest to implement, but as discussions here in the hallway and via email showed, confining touch events to a single widget or item at a time is just too limiting. Multi-point touch is not just about pinching and zooming. People want to use both hands to interact with the UI.

So we changed that. The branch we have supports multiple, implicit touch “grabs.” This means that it’s possible to interact with several widgets and/or QGraphicsItems on the screen at the same time. There are several gotchas though:

  • No explicit grab support. We really don’t have a good answer yet as to what should happen if you call QWidget::grabMouse().
  • No popup support (see above).
  • Recursing into the event loop (i.e. any of the exec() functions in Qt) from a touch event handler can and most likely will break touch event delivery. This is because we need to deliver multiple touch events at a time, and recursing essentially prevents other events from being sent. Again, we don’t have a good answer to if or how this should work.

Teaser

So, the good stuff. Here are a few teasers of multi-point touch working in Qt on the Windows 7 Release Candidate. The first video is a bunch of modified QDials (I hope to add this example to Qt soon), the second is 2 custom QGraphicsItems in a QGraphicsView (see examples/touch/knobs).

QShare(this)

Possibly related posts:

  1. Getting in touch with Qt Quick: Gestures and QML
  2. Touching the X11

20 comments

1 Mohamed-Ikbel Boulabiar May 22, 2009 at 12:19 pm
 

Hi,

I am working on multi-touch on Linux.
I need to communicate with you and please send me a mail to try to make Qt multi-touch available for Linux not only in Win7
this is my mail :
boulabiar .AT. Gmail .DOT. com
or
medikbel .AT. lii-enac .DOT. fr

2 Bradley T. Hughes May 22, 2009 at 12:28 pm
 

Support for multi-touch on Linux is something we haven’t quite been able to do yet. There is no standard interface for multi-touch events from the Linux kernel drivers, and there is no support for multi-touch events in Xorg yet (although there is a GSoC for this). Until that happens, we probably won’t see multi-touch on Linux or X11 for a while (unless we try to integrate with a 3rdpary library that provides multi-touch).

3 linux user May 22, 2009 at 1:37 pm
 

Try using mpx. It is going to be integrated into the X11

4 Stephan Sokolow May 22, 2009 at 1:46 pm
 

Once you start working on Linux Multi-Touch, keep Multi-Pointer X in mind. I don’t have any multi-touch devices, but I’d like to experiment with two-touch gestures by plugging in an extra mouse. (MPX is the feature I’ve been looking forward to the most for the last year or so)

5 Stephan Sokolow May 22, 2009 at 1:50 pm
 

That’s odd. I didn’t think I’d left this tab open for over 10 minutes before commenting. (“linux user” hadn’t commented when the copy I was viewing was loaded)

6 Bradley T. Hughes May 22, 2009 at 1:55 pm
 

Yes, but MPX is not going to be including multi-touch device support. Multiple mice, yes, but not multi-touch. There is some mention of the GSoC project here: http://lists.x.org/archives/xorg-devel/2009-March/000570.html, but I can’t find any real info related to multi-touch and MPX right now. I will have to search more and see what I find.

7 Stephan Sokolow May 22, 2009 at 2:40 pm
 

Of course. I just want to be sure that you can perform multi-touch gestures by combining input from multiple devices.

8 Adam May 22, 2009 at 2:47 pm
 

Integration with CCV (http://ccv.nuigroup.com/) or TUIO (http://tuio.lfsaw.de/) could be useful, as i believe that both of these are cross platform and GPL. These resources are used by the DIY multitouch crowd (ie Webcam with FTIR blob detection).

9 Milian Wolff May 22, 2009 at 3:23 pm
 

Bradley, I think you misunderstood Mohamed-Ikbel: As far as I understand him, _he_ is working on multi-touch support for linux hence he was interested to get in touch with you. I.e. he wants to help you get this astounding piece to us Linux users :)

10 fabo May 22, 2009 at 5:09 pm
 

isn’t it MPX multi-touch support under Linux ? => http://www.youtube.com/watch?v=olWjnfBoY8E

11 Mohamed-Ikbel Boulabiar May 22, 2009 at 6:34 pm
 

Thanks Milian,
Yes I am working on it now,
I will send some demos soon.

MPX isn’t multi-touch, it is multi pointer, and every pointer IS ANOTHER USER.
It is used to allow many users to work on the same machine by connecting every keyboard/Mouse to specific application.

@Fabo: If you analyse the video in youtube you will see that the most of it is mono-touch, then when coming to multipointers, it uses a special application to treat only 2 pointer together.
The hardware used in the video, allow to distinguish up to 4 users
(if you want how, the hardware “sends” electromagnetic signal thru human bodies, then sensors detect this signal from human fingers that behave like antennas)

12 Mohamed-Ikbel Boulabiar May 22, 2009 at 7:45 pm
 

Thanks Milian,
it true I am working on it, but I am not alone.

@Fabo : MPX isn’t multi-touch, it is multipointer, this means, every pointer is ANOTHER USER.
MPX is used to allow many people use the same machine by matching every Keyboard/Mouse connected to selected application.
In the Video, Peter shows almost simple touch, then multi pointer, used by 2 users.
And a customized application to allow drawing.
The hardware he use allow to distinguish 4 users by sending a different signal by user and transforming fingers as antenna to specific signal

13 Thorben May 22, 2009 at 7:49 pm
 

Mohamed: Sounds great, good luck! Could you post some links on some recent developments concerning multi-touch in X? Just curious…

14 Mohamed-Ikbel Boulabiar May 22, 2009 at 8:49 pm
 

OK,

I will post a video demo next days.

Linux kernel is currently being patched to support multi-touch since the 2.6.30-rc5.
Others patches are in the road (some still not merged and others still not sent to developers)

15 Piotr Dobrogost May 22, 2009 at 9:13 pm
 

Sorry for writing it here but I don’t see any other way.
After registering for forums I can’t login (wrong password).
Can somebody help me, please?

16 Ivan May 23, 2009 at 6:51 pm
 

It would be really, really nice to provide easy plugging in of 3rd party solutions. TUIO has already been mentioned and it is used in all kinds of multi touch devices, such as projector tables (similar to MS Surface).
I am building a QT/OpenGL interface for such a device and native QT support for multiotuch would be like a dream coming true, as currently everything must be hacked in.

17 Ariel May 24, 2009 at 3:19 am
 

I implemented tuio suport into a special QWidget by encapsulating single monotouch inside this widget. Multiple widgets can be used at the same time but only one touch is recognized inside each one. I implemented it based on your past ideas about multitouch in Qt. Im interested in helping i can send my code and/or post a video of it working.

18 Bradley T. Hughes May 26, 2009 at 8:32 am
 

Milian: Indeed, you are correct. He sent me an email afterwards explaining what he was doing :)

Ariel: why not create a clone of the mutitouch-and-gestures repo and add your implementation there? I’m sure people would love to test it :P

Also, I forgot to mention that there is a manual test in tests/manual/qtouchevent for testing that the event dispatching works correctly. For anyone interested in trying to implement CCV or TUIO support, that test will help you.

19 Desert May 30, 2009 at 1:40 am
 

Here’s a demo of my work, a styled dialog inside a QGraphics Scene receiving multitouch (in linux), i’ve been following the development in the git branch. Thanks for pointing that tests/manual/qtouchevent.

http://vimeo.com/4908829

20 Mohamed-Ikbel Boulabiar June 10, 2009 at 11:34 pm
 

Hi,
Here you can find the link to the demo :
http://lii-enac.fr/en/projects/shareit/linux.html

I haven’t used Qt there, but why not in the future !

Comments on this entry are closed.

Previous post:

Next post: