O'Reilly logo

Android NDK Game Development Cookbook by Viktor Latypov, Sergey Kosarevsky

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Handling multi-touch events on Windows

Once we have installed the MultiTouchVista driver, or if we happen to have a multi-touch-capable screen, we can initialize an event loop in the application and handle the WM_TOUCH messages.

Getting ready

The first recipe contains all the relevant information about multi-touch handling. In this recipe, we only extend our code for Microsoft Windows.

Note

This book doesn’t discuss about multi-touch input emulation for Mac.

How to do it...

  1. The MinGW toolchain does not include the latest Windows SDK headers, so a number of constants should be defined to use the WM_TOUCH messages:
    #if !defined(_MSC_VER) #define SM_DIGITIZER 94 #define SM_MAXIMUMTOUCHES 95 #define TOUCHEVENTF_DOWN 0x0001 #define TOUCHEVENTF_MOVE 0x0002 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required