查询Winrt App的触控功能

时间:2013-01-22 23:27:21

标签: windows-8 windows-runtime touch capability

  

可能重复:
  Detect whether a Windows 8 Store App has a touch screen

对于WinRT应用程序,有没有办法查询运行应用程序的设备是否支持触摸?我问,因为我有一个游戏的屏幕控制,如果你没有触摸就不需要。

1 个答案:

答案 0 :(得分:3)

Windows.Devices.Input.TouchCapabilities应该这样做。

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

还有一个sample on the dev center