Exit the game on KeyboardInterrupt (don't log this error)

This commit is contained in:
Yohann D'ANELLO 2021-01-08 11:10:10 +01:00
parent ac8c7a0a4c
commit b42f1277b1
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 5 additions and 1 deletions

View File

@ -94,7 +94,11 @@ class Game:
screen.noutrefresh()
self.display_actions(DisplayActions.REFRESH)
curses.doupdate()
key = screen.getkey()
try:
key = screen.getkey()
except KeyboardInterrupt:
exit(0)
return
if key == "KEY_MOUSE":
_ignored1, x, y, _ignored2, _ignored3 = curses.getmouse()
self.display_actions(DisplayActions.MOUSE, y, x)