Microsoft Windows Simulator Touch Emulation

Microsoft Windows Simulator Touch Emulation

Rate This
  • Comments 4

The Windows Simulator is a tool provided in Visual Studio 11 Developer Preview that enables debugging Metro style applications in scenarios requiring hardware support such as rotation and touch. For a quick introduction to the Windows Simulator, see this blog entry. This article will introduce you to Touch Emulation in the Windows Simulator.

Touch Emulation in the Simulator enables developers to test and debug how an application reacts to different touch gestures. The Simulator does all the hard work of converting mouse events into touch events received by the running application. This is especially useful for developers who are creating Metro style applications that are touch-enabled but do not have a touch monitor to test those applications.

To demonstrate Touch Emulation inside the Windows Simulator, we will use the Touch Events Sample provided by the Windows Developer Preview Metro style apps samples. After downloading and unpacking the sample, open the solution TouchEvents.sln in Visual Studio 11 Developer Preview, then Debug the sample targeting the Windows Simulator:

image

The sample will run inside the Windows Simulator and will look something like this:

image

This sample code recognizes touch events in the right rectangle and displays the information about those events in the left rectangle. Using the Windows Simulator Touch Controls found on the Simulator palette, we can switch between Mouse mode and Touch mode:

Post2

When in Touch mode, the Windows Simulator shows a special mouse pointer indicating that it is in Touch Emulation mode. The Simulator will convert mouse clicks into touch events, and the application receives touch events exactly as it would if they were generated by a physical touch device.

image

The Windows Simulator can also simulate two finger gestures, such as the Pinch/Zoom gesture and the Rotate gesture. When using the two finger gestures, the Windows Simulator will display two contact points.

image

In Pinch/Zoom mode, use the mouse wheel to set the two contact points closer or farther apart from each other. If you click the left mouse button and rotate the wheel simultaneously, the Windows Simulator will send touch events to the target application as if the user was performing a Pinch/Zoom gesture on a physical touch device. Similarly, in Rotate mode you can use the wheel to rotate the two contact points relative to each other.

The Windows Simulator allows emulating the following touch gestures:

  • Tap (single contact)
  • Hold (single contact)
  • Double Tap (single contact)
  • Pan/Swipe (single contact)
  • Flick/Inertia (single contact)
  • Pinch/Zoom (2 contact points)
  • Rotate (2 contact points)

We encourage you to use the Touch Emulation features in the Windows Simulator to develop your Windows 8 applications. These features allow you to test and debug your applications to ensure they work correctly for touch - without having a physical touch device.

To learn more about Touch input in Metro style applications, see the following articles:

Responding to Touch Input
Touch Input Quickstart

Thanks,
Mynor Ivan Muralles
Software Design Engineer, Visual Studio

Leave a Comment
  • Please add 4 and 2 and type the answer here:
  • Post
  • Bad, bad idea. Now I don't have a business reason to get a touchscreen monitor. Curse you Visual Studio team and your good ideas. ;)

  • This would also be really useful for the Windows Phone 7 emulator as an alternative to using the Multi-Touch Vista project. (stackoverflow.com/.../how-can-i-simulate-multi-touch-in-the-windows-phone-7-emulator)

  • Ugly-looking emulator, ahh.

    At leats, make Windows-logo button look normal.

  • Ugly-looking emulator, ahh.

    At least, make Windows-logo button look normal.

Page 1 of 1 (4 items)