Win 7 - Touch
Few weeks back we got access to HP's Touch Smart laptop with Win 7 and that was our first real exposure to working with Touch. Touch isn't something of a science fiction anymore and most new mobile devices support touch capabilities, though not necessarily multi-touch. Microsoft Surface was a very interesting innovation in this space, but was limited to some extent on its usage due to factors like restricted availability of surface table, its cost, and it being horizontal and hence not suitable for many business applications.
Windows 7 now natively supports multi-touch and if you have the right hardware like HP touch smart laptop, you can start to program some real cool applications. When I first read about WPF 4.0 will support touch at framework level, I wasn't sure what it meant and hence I decided to spend some time understanding this a bit more. Here I am not going deep into any of these aspects, but just want to highlight a few important aspects of touch and how to program for it.
The first question really is what is multi-touch and how is this different from say the stylus based Tablet PCs. Simplistically put, multi-touch literally means ability to handle multiple touch points at the same time. So if you can put more than 1 finger on the device, it is able to recognize all of them and provide these via relevant APIs for programmatic manipulation. To add to this will be ability to recognize gestures like pan, zoom, rotate etc and again providing suitable API backing for applications to program against them.
The next question that needs some digging into is, do I really need to handle any specific messages/API? When I run existing applications on Win 7 touch device, I am able to get basic manipulation working without having done anything. The point to understand here is that the underlying drivers and OS do provide for touch specific information, but since many applications (or rather almost all applications as of today) aren't touch aware, they still need to be responsive in some sense. Hence the touch messages are eventually promoted as regular mouse messages. It is due to this behavior that most applications will continue to work without any specific handling of touch. However the response may not be very good and at times seem jerky. Also you may end up with unwanted behavior like in one of our apps, we had a touch and move behavior, but while moving, the finger would go over another control and it would react even though it wasn't supposed to. The mouse event promotion probably triggered the other control to also react.
To address this an important aspect is ability the suspend mouse event promotion. The high level behavior hence will be to capture touch down event, suspend mouse event promotion, continue to handle touch related events to provide for pan, zoom, flip, rotate etc and finally handle touch up to revert to normal behavior. In our application we did this and we had much better touch response from the application (apart from the hardware issues where the touch calibration will frequently go out of synch).
Applications like IE 8 and Paint are already touch aware and if using them on Win 7 with touch hardware, you can play around with them. IE will allow zoom in-out of content via touch and paint will allow you to draw with multiple fingers. To know more about touch support, check these links
Finally, one last aspect is do I need to do something different when designing for touch aware applications. One answer to this is already discussed in previous question in terms of WM_TOUCH message handling. Some of the other aspects are to create larger controls so that touching is easier and the application can better respond to it. Also note certain behaviors will also have to change like you can no longer program for mouse hover and tooltip kind of user experience as these won't work well with touch interface. When using stylus, it does offer proximity sensor and when it is close to the screen, it can behave like mouse hover, but not with regular touch. You can check out more design guidance on touch applications here. Another document of interest will be How to Design and Test Multitouch Hardware Solutions for Windows 7.
The various links that I have provided above should help you get started on touch journey. There is also an interesting session from PDC 2009 on Windows Touch Deep Dive. However note that this talks at low level details and raw windows API and programming and isn't really talking about managed programming.
Hope you will find this interesting and would like to get started with touch interface is not already doing that. I would like to hear from you in terms of would you consider touch in your applications and what kind of applications would they be?