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

Re: [pygame] Keyboard input, too fast!



The get_pressed function returns the current state of the keys. So if you 
call it inside a while-loop, it will print Hello as long as you keep the 
key down (which is bound to be at least a few loop iterations). An easy 
way to get a single notification when a key is pressed down is to listen 
to KEYDOWN events from the event queue.

events = pygame.event.get([KEYDOWN])

--
Sami Hangaslammi