Infosys Microsoft Alliance and Solutions blog

« VisualStateManager's Benefits | Main | Multitenancy and SharePoint 2010 »

Win 7 - Difference between Touch and Gesture

In my earlier blogs (here and here), I have talked about Win 7 and the new touch experience it brings.

When talking about touch, there are essentially two aspects - touch and gestures and during a recent internal discussion, I felt that these aren't that well understood by people. What's really the difference between the two and what it means to be supporting either of these?

In this blog, I will try and explain them as I have understood them. If you have a different view do share.

The very first way I would like to describe the difference between touch and gesture is, treat gesture like out of box controls, like say for ASP.NET. They are available with basic functionality and allow one to get applications built quickly. Gestures are like that and allow some quick support to application to react to the touch inputs. Touch on other hand can be treated as custom controls, where you implement things on your own and hence get to handle the raw power of the platform. This is more tedious, but in terms of features, can provide lot more than what gesture may offer.

Touch in Win 7 is also related to manipulation events. I found this interesting comparison between gesture and manipulation. If you look at the figures, they very clearly show the difference between the two and also bring out another important point when working with touch on Win 7, a point that people tend to miss out - gesture and touch don't go hand in hand.

What is evident from the figure in that blog is that the system needs to wait till gesture is completed, then check its internal respository to figure out what the gesture was and what is mapped against and then eventually invoke that command. Touch or manipulation on the other hand are immediate and the object/application needs to react immediately to the inputs. This clearly means that gesture and touch are mutually exclusive and can't be handled together. MSDN article also states this - "By default, you receive WM_GESTURE messages instead of WM_TOUCH messages. If you call RegisterTouchWindow, you will stop receiving WM_GESTURE messages." See more details here.

People often wonder that if pan, zoom rotate are really gestures and I am handling touch messages, how do these still work, since we just said that geature and touch are mutually exclusive. These work because to enable legacy support, Win 7 converts the pan, zoom and rotate gestures to appropriate scroll and mouse events, which applications would anyway be handling. See some details on this here. While this legacy support will work, it may not give you the best of results. For that you may have to still look at handling WM_GESTURE specific messages (at the cost of WM_TOUCH). See more details here.

If you have any thoughts or comments on this, do share.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Please key in the two words you see in the box to validate your identity as an authentic user and reduce spam.

Subscribe to this blog's feed

Follow us on

Blogger Profiles

Infosys on Twitter