5

There are certain elements of Win 8 Store App UI that change based on whether the user has a touch screen. For example, a ScrollViewer, when rendered on a non-touch screen shows a vertical scrollbar. On a touch screen, the scrollbar is hidden.

I would like to tailor my application UI, adding extra controls, for non-touch screen users. Does anyone know if it is possible to detect whether a user has a touch screen?

ColinE
  • 68,894
  • 15
  • 164
  • 232

2 Answers2

6

You can use the Windows.Devices.Input namespace to detect various capabilities (touch, keyboard, mouse, etc.). For example, the TouchCapabilities class has a TouchPresent property you could check to see if there's a digitizer available.

Take a look at the Input: Device capabilities sample to see them in action.

Chris Bowen - MSFT
  • 9,589
  • 1
  • 17
  • 13
2

If you are using HTML/JS you can query it like this

var touchCapabilities = new Windows.Devices.Input.TouchCapabilities();
var isTouchCapable = touchCapabilities.touchPresent;
Patrick Klug
  • 14,056
  • 13
  • 71
  • 118