Here's what I'd do.

1. On mouse press, capture the position of the mouse and register that
"scrubbing mode" is active.
2. When scrubbing mode is active, in your `mouseMoveEvent` compare the
current position to the one stored on mouse press
3. The distance (e.g. Manhattan length
<http://doc.qt.io/archives/qt-4.8/qpoint.html#manhattanLength>) is how much
to scrub.
4. If the delta is positive, then you're scrubbing to the right. Negative
means scrubbing to the left.
5. On mouse release, disable scrubbing mode.

This should help produce a smooth and predictable scrubbing behaviour.

On 22 June 2018 at 11:06, Panupat Chongstitwattana <[email protected]>
wrote:

> Hi.
>
> I'm trying to create a turntable viewer and in need of some guidance
> please. In this view, I want to be able to click and hold left mouse button
> then drag left/right to turn the turntable, which are image sequences.
>
> My questions:
>
> - Is there other way I should approach this? The mouse move event triggers
> too fast and when I try to print out new image names they appear too
> rapidly.
>
> - How can I detect if I am moving mouse left or right?
>
> - The pixmap doesn't seem to repaint even if I explicitly tells it to.
>
> Appreciate any help. Thank you!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/python_inside_maya/d0541c00-46a5-42da-9cef-
> 36e66ae76813%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/d0541c00-46a5-42da-9cef-36e66ae76813%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOB2RsR7i4LzT6CoETsYw%3DbzmN95_oF_UZWbB1XLeJ7c7A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to