Custom gesture
-
Hi...
Is there any idea how to make a custom gesture for many grab points of a mouse cursor?
If a user move a cursor like a circle, so the program recognize it for a special task.
Now my idea is to record every mouse pixel using mousePressEvent(), and from a number of pixels I will calculate the center of the circle gesture to find its center.
Is there any opinion to help, I appreciate your suggestion. Thank you -
For custom gesture you can subclass "QGestureRecognizer":http://qt-project.org/doc/qt-5.0/qtwidgets/qgesturerecognizer.html#details class but for that you need to check for Gesture Programming Examples first.
"Check this":http://www.developer.nokia.com/Community/Wiki/Custom_Swipe_Gestures_in_Qt
-
Thank for suggestion, but it was for swipe. I found just now about a product like StrokeIt and mention about plugin. Is it possible using Qt and plugin, is there a suggestion and tutorial about plugin and Qt. Thanks..
-
There was an excellent article in Qt Quarterly by John Thelin on the subject of custom mouse gestures which you can find "here":http://doc.qt.digia.com/qq/qq18-mousegestures.html. I've produced two derivative examples of this: the "first":http://www.gulon.co.uk/2013/01/09/recognising-mouse-gestures-with-pyqt4/ mirrors John's work and the "second":http://www.gulon.co.uk/2013/01/14/pyqt4-mouse-gestures-part-deux/ uses/subclasses "QGestureRecognizer":http://qt-project.org/doc/qt-5.0/qtwidgets/qgesturerecognizer.html#details (as mentioned by Sam). They are written in/for Python/PyQt4 but the general principles and mechanisms are relevant to Qt whatever the language.
Hope this helps ;o)
-
Thank you very much for the references... This is very helpful... :)