[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] newbie: events and timing



Christoph Lehmann wrote:
I have some python code, where I wait in a loop for a trigger signal on
the lpt port.
during this waiting-loop: can I receive any mouse button events? are
they logged with some time-stamps, so that I can get, after I left my
waiting loop, the info, which mouse button has been pressed, and also at
what time.
there are no timestamps available on input events, although that would be really nice. you may want to 'block' the mousemotion events, since they can add up pretty fast and fill up sdl's not-too-large queue.

pygame.event.set_blocked(pygame.MOUSEMOTION)

if you never need the mouse motion events you can just leave it blocked. otherwise you can call set_allowed() when you are ready to start working with the event queue again.

hopefully there is some sort of timeout or polling method you can use for the lpt trigger. otherwise the graphics window will be a bit disabled while waiting for the trigger to happen.

--
"Neither will I tell you by what authority I do these things"
pete*shinners.org