1

Possible Duplicate:
Detect whether a Windows 8 Store App has a touch screen

For WinRT apps, is there a way to query if the device running the App supports touch or not? I ask because I have on screen controls for a game that aren't needed if you don't have touch.

Community
  • 1
  • 1
Nick Banks
  • 4,298
  • 5
  • 39
  • 65

1 Answers1

3

Windows.Devices.Input.TouchCapabilities should do it.

var t = new Windows.Devices.Input.TouchCapabilities();
bool hasTouch = t.TouchPresent != 0;

There's a sample on the dev center as well.

Jim O'Neil
  • 23,344
  • 7
  • 42
  • 67