Filter events we do not care for

master
LEdoian 3 years ago
parent 1afe42f41d
commit 72cbd765da

@ -14,8 +14,8 @@ colors = {
BORDERCOLOR = (64,64,64)
W = 1920 * 5 // 6
H = 1040
W = 1920
H = 1080
CELLSIZE = 8
CELLBORDER = 0
CELLMARGIN = 3
@ -73,6 +73,8 @@ class Visualisation:
def run(self, *, refresh=2):
pygame.time.set_timer(pygame.USEREVENT, refresh * 1000)
pygame.event.set_blocked(None)
pygame.event.set_allowed([pygame.USEREVENT, pygame.VIDEORESIZE, pygame.VIDEOEXPOSE, pygame.QUIT, pygame.KEYDOWN])
self.draw()
while True:
ev = pygame.event.wait()

Loading…
Cancel
Save