From 72cbd765da5fc92a3601a4deb95205c1c9ae96dc Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Fri, 13 Aug 2021 04:09:56 +0200 Subject: [PATCH] Filter events we do not care for --- ddresc_visu/draw.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ddresc_visu/draw.py b/ddresc_visu/draw.py index 5efd606..9063d5f 100644 --- a/ddresc_visu/draw.py +++ b/ddresc_visu/draw.py @@ -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()