PDA

View Full Version : Touch events not recognized for trackpad



mentalmushroom
12th February 2015, 15:35
Hello. I would like to implement pinch zooming feature for my application. I started from checking Qt samples (pinchzoom and gestures) and noticed those samples do not work for my trackpad :( From the other side, touch screen events seem to be recognized fine. I am not sure, were those apps intended for some certain devices or device types only? Is there something that needs to be changed in the code in order to get it working on the trackpad or is that a bug?

I have no problems when using the trackpad to zoom or scroll in my web browser, for example, so the device must be ok.

I tried Qt 4.8.6 and Qt 5.4 - none of them work. My platform is DELL XPS 15 9530 + Windows 8.1 x64.

d_stranz
12th February 2015, 18:19
If the driver for your trackpad doesn't support gestures (ie. it is implemented as a mouse only), then you won't see those events. Check the driver for your Dell in Control Panel - perhaps there is a setting to enable this if it is supported in the driver.

mentalmushroom
12th February 2015, 18:33
Gestures are enabled. As I told before, I am using pinch zooming in the web browser without any problems, two, three and four finger gestures also work fine. The issue seems to occur in Qt applications only.

d_stranz
13th February 2015, 15:54
Maybe you need QGestureRecognizer? Or QWidget::grabGesture() or QGraphicsObject::grabGesture()?

mentalmushroom
13th February 2015, 15:55
Umh... but why Qt samples do not work?

d_stranz
13th February 2015, 15:58
Our posts are bumping into each other.

The examples may not implement gesture grabbing as mentioned above.

mentalmushroom
13th February 2015, 16:02
Thanks, i will check QGestureRecognizer.

d_stranz
13th February 2015, 16:10
Reading deeper into the docs, QGestureRecognizer is needed only if you are implementing custom gestures. QWidget::grabGesture() should be all you need for standard gesture support.

Try modifying one of the Qt Graphics / View examples to add grabGesture support to the view widget, see what happens. Or modify a dialog-based example to add grabGesture to the dialog class. You should then be able to tap buttons, I think. I don't have a gesture input device, so I can't try it.