Game Development Reference
In-Depth Information
Setting up multi-touch emulation on
Windows
Testing a touch-based interface is hard without the hardware, but even with the Android
hardware available, we do not have the luxury of a step-by-step debugger. Fortunately,
Windows supports touch screen hardware and can provide WM_TOUCH events for our
application. This recipe shows a trick, utilizing multiple mice to emulate touch events.
Getting ready
This recipe relies on a third-party Windows driver, the MultiTouchVista, a user input
management layer that handles input from various devices. It can be downloaded from
http://multitouchvista.codeplex.com/ .
How to do it...
1.
First, we need to install the system driver. We extract the MultiTouchVista_-_
second_release_-_refresh_2.zip ile, the latest release at the time of writing,
and then open the command line with administrator rights. If the console is run
without administrator privileges, the installation of the driver fails. The extracted
folder contains the Driver subfolder, where you should choose either the x64
or x32 folder, depending on the type of your operating system. In that folder,
we execute the following command:
>Install driver.cmd
2.
A dialog appears, asking whether you want to install this device software or not; you
should click on the Install button. Once the installation is complete, you will see a
message on the command line.
3.
The next thing we do, is activate the driver in Device Manager. We open the Control
Panel, then the Device Manager window. There, we ind the Human Interface
Devices item in the list. We right-click on the Universal Software HID device, the one
we have just installed the drivers for. We choose Disable from the context menu to
disable the device. In the conirmation before disabling the device, we just respond
with Yes. After that, we re-enable this device again by right-clicking on this node and
choosing Enable.
4.
Now, since we emulate the multi-touch with mice, we should somehow display
the touch points on the screen, because otherwise it is impossible to know where
the mice pointers are. In Control Panel | Hardware and Sound, we open the Pen
and Touch window. The Touch tab contains the Show the touch pointer when I'm
interacting with items on the screen checkbox, which should be enabled.
 
Search WWH ::




Custom Search