[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] Keyboard handling



David Clark wrote:

> Chris Armstrong writes:
>  > ...
>  > I couldn't find anything on 'key release' events, and
>  > having a 'timeout' period for the key event seems nasty. Any suggestions?
>  > 
> 
> Hmm. There is a pygame.KEYUP event, to match the pygame.KEYDOWN event
> type. It should be added to the queue every time a key is released. Is
> it not suitable for what you're doing?

I've been using pygame.event.pump(),
keystate = pygame.key.get_pressed(), and then doing a bunch of
'if keystate[K_LEFT]: boo' and whatnot since now. I've been tinkering 
with pygame.event.get([KEYUP, KEYDOWN]), but I'm not sure how to handle 
the list of Events that I get..
Would I do something like
if pygame.event.Event(...) in keystate: foo?
Thanks for any help, again :)
--
Chris Armstrong

____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org