Detect whether a Windows 8 Store App has a touch screen

后端 未结 2 959
無奈伤痛
無奈伤痛 2020-12-10 19:08

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 s

2条回答
  •  清歌不尽
    2020-12-10 19:22

    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.

提交回复
热议问题