Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect whether a Windows 8 Store App has a touch screen

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?

like image 755
ColinE Avatar asked Sep 30 '12 19:09

ColinE


1 Answers

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.

like image 198
Chris Bowen - MSFT Avatar answered Sep 23 '22 18:09

Chris Bowen - MSFT