c++ - 检测屏幕的触摸属性

标签 c++ qt qml multi-touch touchscreen

在 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()枚举可用触摸设备的函数,以及capabilities()功能来检查各个设备的能力。要检查多点触控支持,您可能会调用 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().

关于c++ - 检测屏幕的触摸属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33543483/

相关文章:

c++ - 使用 3 个位置和法线进行光线追踪的内插三角形表面的最佳方法

c++ - 解引用指向 union 成员的指针

java - 使用 QMessageBox 从选项列表中进行选择

c++ - QHeaderview中的排序指示器是用什么画出来的?

c++ - 正则表达式工作很慢

qt - 如何翻转单选按钮?

c++ - 在函数调用中是否会发生左值到右值转换?

c++ - 如何在AngelScript中注册SFML Vector2运算符?

list - 在 QML 中滑动删除

qt - Qml 如何恢复绑定(bind)?