Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detecting touch properties of the screen

Is there a way in QML or Qt or C++ to know if the screen (or the platform) support tactile, and more specifically, if the screen support multitouch

Is this even possible ?

EDIT :

On windows it seems we could try to enumerate the device to find one that match https://support.microsoft.com/en-us/kb/259695

This should also be possible on linux

RELATED :

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?

like image 260
BlueMagma Avatar asked Oct 25 '25 05:10

BlueMagma


1 Answers

You can use the static 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().

like image 187
Mitch Avatar answered Oct 26 '25 17:10

Mitch



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!