diff options
author | Paul Oliver <contact@pauloliver.dev> | 2024-02-29 02:29:14 +0100 |
---|---|---|
committer | Paul Oliver <contact@pauloliver.dev> | 2024-02-29 02:29:14 +0100 |
commit | bb9e0f1631dd0773ba24d023b57cafba4b283a74 (patch) | |
tree | f94482d735a854e438227973b449a138cbcd1c9f /bin/handler.py | |
parent | 3693aced9cc6417b4540dfda08f7733146ce0392 (diff) |
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.
Diffstat (limited to 'bin/handler.py')
-rw-r--r-- | bin/handler.py | 9 |
1 files changed, 1 insertions, 8 deletions
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) |