检测屏幕的触摸属性

Detecting touch properties of the screen

在 QML 或 Qt 或 C++ 中有没有办法知道屏幕(或平台)是否支持触觉,更具体地说,如果屏幕支持多点触控

这可能吗?

编辑:

在 windows 上,我们似乎可以尝试枚举设备以找到匹配的设备 https://support.microsoft.com/en-us/kb/259695

这在 linux

上也应该可行

相关:

What's the best way to detect a 'touch screen' device using JavaScript?

Is there a way to determine if the current screen supports touch?

您可以使用静态 QTouchDevice::devices() function to enumerate the available touch devices, and the capabilities() function to check the capabilities of individual devices. To check for multitouch support, you would probably call maximumTouchPoints()

The QTouchDevice class describes the device from which touch events originate.

Each QTouchEvent contains a QTouchDevice pointer to allow accessing device-specific properties like type and capabilities. It is the responsibility of the platform or generic plug-ins to register the available touch devices via QWindowSystemInterface before generating any touch events. Applications do not need to instantiate this class, they should just access the global instances pointed to by QTouchEvent::device().