from time import time
import pygame
pygame.init()
t = time()
Events = pygame.event.get()
print(Events)
end = False
while not end:
if time()-t>3:
print(Events)
Events = pygame.event.get()
t = time()
I wrote the following to know about the event queue in pygame.
Here I am waiting for three seconds until the next event.get()
is called and in these 3 seconds, I do a lot of events through my keyboard and mouse,
But still I see a blank event queue in the next print...
Why is it so because if I am not wrong, pygame queues all the events that happen and event.get()
returns us the queue and then clears it.