The TouchInjection API is originally available to C++ applications, but with the TCD.System.TouchInjection package, it can also be used in C# applications. This sample shows how to make pinch/zoom gestures.

Building the Sample

The sample can be built in Visual Studio 2012/2013 and used on Windows 8 or 8.1.


With reflection it was possible to make all features of the TouchInjection API available for C# applications.

After the applications starts, press one of the buttons to simulate a gesture. The gestures will execute after a delay of 2 seconds. By switching to the Start Screen, you can watch the pinch/zoom gestures zoom out and in.

The TCD.System.TouchInjection package also includes IntelliSense descriptions that should make it easy to use. When injecting touch input yourself, pay special attention to the PointerInfo.PointerId property. Any attempt to inject touchpoints with invalid PointerId (for example releasing a point that was not in contact before..) will fail. Search MSDN for additional TouchInjection samples that can easily be tranferred from C++ to C#.

Source Code Files

More Information

For more information on TCD.System.TouchInjection, see