Windows 7 gives users the ability to manage applications with the touch of their fingers, using no intermediate device. This expands the stylus-based capabilities of tablet PCs. Unlike other pointing devices, this new capability allows multiple input events at the same time from different pointing locations, and it enables complex scenarios, such as managing applications with ten fingers or with multiple simultaneous users. However, to pull this off, we have to adapt our application's user interface and behavior to support this new input model.
In this Hands-On Lab, you will learn how to manage gesture events, including:
Understanding the implications of manipulating multiple touch events simultaneously
Checking for multi-touch hardware existence and readiness
Extracting information from the WM_TOUCH Windows Message
You must have the following items to complete this lab:
Microsoft Visual Studio 2008 SP1
The Windows 7 SDK
A multi-touch hardware device
To have a Multi-Touch driven application you can choose one of three approaches, the Good, The Better and the Best.
The “Good” approach is the easiest between the three. You should design your application user interface with touch ability in mind. Use large and clean Win32 based controls that make a natural interface for better user experience. Touch abilities such as scrolling come from the Win32 controls. There is no need for extra work. For example, try to scroll the document that you are reading now with your fingers! This is the “Good” approach. The "Better" approach lets the system receives the various low level touch events and get the result of the heuristics that the system does with these events. For example the user made a rotation movement on the screen; the system will issue a rotation gesture event with the rotation angle. Although the "Better" approach is easy to use, it has its limitations. Using gesture one cannot get Rotate, Translate and Scale simultaneously. Also you cannot handle many different touch based actions in the same time. For example two users that operate different areas of the Window.
The “Best” approach is to read the low level touch events as the input to the application. Applications like “Piano” or complex controls like multiple-sliders that can be operate simultaneously are good examples. Run MS Paint, select a drawing tool from the gallery and draw with five of your fingers (if the hardware permits)
In this Hands-On Lab you we will mimic the new MS Paint multi-touch painting feature. We will use the “Best” approach. We will read and use the raw touch events. Enter the Low-level WM_TOUCH Multi-touch message decoding.
About the Multi-touch Scratchpad Application
The Multi-touch Scratchpad application presents a simple window that allows simultaneously drawing of continues lines with your fingers. In the HOL folder you can find a project for each task of the lab. The Starter folder contains files that you will need during the lab. A finished version of the lab is located in the Final folder.