[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Not getting mouse up event
I tried 'pump,' but it didn't help. I don't totally understand 'pump,' but
what I gather from the documentation is that, so long as you are making a
call to 'event' every tick, then you don't need it.
I am using Gentoo Linux and Pygame 1.6.1.
Also, the code I submitted was new, right before I mailed it, and I found that
it was also causing the input to frequently lock up. The game would be
running, but after a few seconds, all input, including clicking on the 'x' in
the window, would be disabled. I can't understand why.
Here's that code again:
key_ups = [event.key for event in pygame.event.get(KEYUP)]
mouse_ups = [event.button for event in pygame.event.get(MOUSEBUTTONUP)]
key_downs = [event.key for event in pygame.event.get(KEYDOWN)]
mouse_downs = [event.button for event in pygame.event.get(MOUSEBUTTONDOWN)]
if K_ESCAPE in key_downs or pygame.event.peek(QUIT):
sys.exit()
I changed it back to this:
key_ups = []
key_downs = []
mouse_ups = []
mouse_downs = []
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()
elif event.type == KEYUP:
key_ups.append( event.key )
elif event.type == KEYDOWN:
if event.key == K_ESCAPE:
sys.exit()
else:
key_downs.append( event.key )
elif event.type == MOUSEBUTTONDOWN:
mouse_downs.append( event.button )
elif event.type == MOUSEBUTTONUP:
mouse_ups.append( event.button )
...but this hasn't had any affect on my original, not getting mouse up, issue.
-austin
On Monday 29 November 2004 03:10 am, andrew baker wrote:
> It sounds like you need to pump the event queue. I use in
> event.getkeys(), so I don't need to pump the queue, but you're using
> Getinput, so I guess you might need to.
>
> On Sun, 28 Nov 2004 17:55:38 -0800, Fred Burton <flbl@go.wifl.at.org> wrote:
> > Austin Haas wrote:
> > >I am having an issue where I'm occasionally not receiving the
> > > MOUSEBUTTONUP event from the event queue, until I execute another mouse
> > > event.
> >
> > ..
> >
> > >Anyone know what's going on?
> > >
> > >(Also, the cursor page in the online documentation is NOT FOUND.)
> > >
> > >-austin
> >
> > What OS and version of pygame are you using?