[PyQt] simulate fluent mouse move trajectory

Peter Irbizon peterirbizon at gmail.com
Tue Apr 1 11:03:51 BST 2014


Hello,

I am experimenting with mouse move and cursor position. I would like to
simulate fluent mouse move from position1 (current first print point) to
position2 (example 100,500). With this code mouse simply "jump" to second
position. How can I make nice trajectory with move time for example 1s?

It should not be simple straight line but curved (up or down).
this is my code:

    from PyQt4 import QtGui, QtCore

    point = QtGui.QCursor.pos()
    print point

    QtGui.QCursor.setPos(100,500)

    point = QtGui.QCursor.pos()
    print point
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140401/a6fa6960/attachment.html>


More information about the PyQt mailing list