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

Re: [pygame] event.get(), event.poll() only return keyup/keydown while mouse is moving



are you calling __poll_pygame in a loop?  pygame.event.get() only gets
the currently queued keypresses, it doesn't just sit there getting
events.  You have to call it.  so maybe you are only calling
__poll_pygame when the mouse is moving or something of that sort.  By
the way, why are you using __'s for naming your functions? just
curious.

On 5/17/05, Patrick Chasco <patrick@xxxxxxxxxxxxxx> wrote:
> I'm having a problem with event.get() and event.poll(). It seems that
> these two functions will only return KEYUP/KEYDOWN events while the
> mouse is moving over the pygame window, or moving at all while in
> fullscreen mode. event.wait() works as intended.
> 
> Here's the code:
> [from engine.py]
> def __init_engine(self, mode, fullscreen):
>    pygame.init()
>    if fullscreen:
>        fullscreen = pygame.FULLSCREEN
>    self.screen = pygame.display.set_mode(mode, fullscreen)
> 
> [from event.py]
> def __poll_pygame(self):
>    for e in pygame.event.get():
>        print e.type
> 
> Anybody have any ideas?
>