From bb9e0f1631dd0773ba24d023b57cafba4b283a74 Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Thu, 29 Feb 2024 02:29:14 +0100 Subject: ESCAPE key no longer quits simulation. [#19] I felt it was too easy to quit the simulation accidentally. Now, a user has to type 'q' or 'quit' on the console in order to exit. --- bin/handler.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'bin/handler.py') diff --git a/bin/handler.py b/bin/handler.py index 9305d14..7bde479 100644 --- a/bin/handler.py +++ b/bin/handler.py @@ -25,8 +25,6 @@ import curses class Handler: - ESCAPE_KEY = 27 - def __init__(self, sim): """ Handler constructor. Simply link this class to the main simulation class and printer class and create symbol dictionary. @@ -41,12 +39,7 @@ class Handler: ncurses' getch() function, thus, they must be transformed into their character representations with 'ord()'. """ - if cmd == self.ESCAPE_KEY: - self.__sim.lib.sal_main_save( - self.__sim.save_file_path.encode("utf-8") - ) - self.__sim.exit() - elif cmd == ord(" "): + if cmd == ord(" "): self.__sim.toggle_state() elif cmd == curses.KEY_LEFT: self.__printer.flip_page(-1) -- cgit v1.2.1