It isn't generally possible to know that the end of the buffer has been
reached, because these events can just keep coming. There are some options,
though:

1. you could set a small delay on handling the event, and restart the
counter on each new event. That way, your response is limited to ~50ms, but
you will only trigger the handler when there haven't been any new events in
that time.
2. use mouseup event, rather than position updates, and only fire when the
mouse has finished moving (may not make sense for your use case, if you
want to update while dragging)

-Min

On Fri, Oct 7, 2016 at 6:55 PM, Bruce Sherwood <[email protected]>
wrote:

> Using the vpython module one can drag an object through a 3D scene. Mouse
> events are sent regularly from the browser to the server, and I gather they
> are buffered until the Python program reaches the end of a cell, then all
> of them are sent. I would like to use only the most recent mouse position
> rather than process all of the buffered events. When reading these
> messages, is there a way to ask whether I've reached the end of the event
> buffer?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jupyter/d0ae8834-7a86-40f9-a834-3f8fdec0b0cc%40googlegroups.com
> <https://groups.google.com/d/msgid/jupyter/d0ae8834-7a86-40f9-a834-3f8fdec0b0cc%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 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CAHNn8BWCVVSBnCnrF3UsxZizx0AMP6QABpvH8vmovugYFj-O1w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to