gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-29 20:56:28 24 4
gpt4 key购买 nike

在 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com