Linux multi-touch

I have two questions:

  • How to simulate touch event in linux.
  • How to work with multitouch on Qt on Linux.
+6
c ++ linux qt multi-touch
source share
2 answers

You can simulate touch events by calling qt_translateRawTouchEvent directly. (This method is not documented, but it is in qapplication.cpp and exported).

You want to put this at the top of your file:

 // forward-declaration of Qt internal function Q_GUI_EXPORT void qt_translateRawTouchEvent(QWidget *window, QTouchEvent::DeviceType deviceType, const QList<QTouchEvent::TouchPoint> &touchPoints); 

Function call syntax:

 qt_translateRawTouchEvent(targetWidget, deviceType, points.values()); 

In your case, call this method using (NULL, QTouchEvent::TouchScreen, touchPoints) , where touchPoints is your list of points that the user has currently touched. This should work in Qt 4.7 and 4.8, at least perhaps earlier in Qt 5, but I have not tested this.

+2
source share

For the multitouch question, you probably want to look at the Gestures API that Qt added.

+3
source share

All Articles