From 127e77b1909d1e799ec95277c7af5d515ec87da1 Mon Sep 17 00:00:00 2001 From: shokre Date: Thu, 16 Sep 2021 15:30:17 +0200 Subject: [PATCH] feat: exit on ESC --- orao.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/orao.py b/orao.py index 71c1b75..d384157 100755 --- a/orao.py +++ b/orao.py @@ -39,6 +39,10 @@ while running: orao_kbd_listener(event, cpu) + if event.type in [pygame.KEYDOWN, pygame.KEYUP]: + if pygame.key.get_pressed()[pygame.K_ESCAPE]: + running = False + if event.type == pygame.USEREVENT + 1: screen.blit(background, [0, 0]) screen.blit(pygame.transform.smoothscale(terminal, (512, 512)), [150, 140])