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

RE: [pygame] Capturing Multiple Keyboard Inputs



> On 1/15/2012 8:16 PM, Ian Mallett wrote:
>>>
>> You should use pygame.key.get_pressed() to check whether the left/up 
>> keys are pressed.  Something like:
>>
>> while pygame.event.get(): pass
>> key = pygame.key.get_pressed()
>> if key[K_LEFT]: #whatever
>> if key[K_UP]: #whatever

I understand the reasoning behind get_pressed. What's the significance of
while pygame.event.get(): pass
Is that what you use instead of the for loop to step through the events in the queue, or is that the main event loop? Should I be putting that in instead of 
for key in pygame.event.get():
in order to look through all of the generated events?
Thanks,
Ryan