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

Re: [pygame] newbie: events and timing



On Tue, 15 Apr 2003, Christoph Lehmann wrote:

>Hi
>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.

Alternatively you can use a thread for the blocking wait and let the main
part of your application proceed as normal, at least chewing events. The
thread can post an USEREVENT to the event queue once it has done what it
was supposed to do. 

Not everyone likes threads though, so if you receive any messages critical
to using threads you can safely ignore them as FUD. :)

-- 

 He says gods like to see an atheist around. Gives them something to aim at.
                                            -- Terry Pratchett, Small Gods