Detect whether a Windows 8 Store App has a touch screen

后端 未结 2 947
無奈伤痛
無奈伤痛 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:17

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

    var touchCapabilities = new Windows.Devices.Input.TouchCapabilities();
    var isTouchCapable = touchCapabilities.touchPresent;
    
    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题