X-Git-Url: https://plomlompom.com/repos/feed.xml?a=blobdiff_plain;f=rogue_chat_curses.py;h=8fc2817cbaf45dd1582a84d83e630f38e2cabb5a;hb=ae71aee13ed42ca8aa7d503746419ef975abc667;hp=6f136387b33f5353c1216fb13163cdb10da1ba93;hpb=52b01fc00d6ea2c053f9022981498b97ebd05839;p=plomrogue2 diff --git a/rogue_chat_curses.py b/rogue_chat_curses.py index 6f13638..8fc2817 100755 --- a/rogue_chat_curses.py +++ b/rogue_chat_curses.py @@ -1086,15 +1086,20 @@ class TUI: self.do_refresh = True except curses.error: continue - self.show_help = False + keycode = None + if len(key) == 1: + keycode = ord(key) if key == 'KEY_RESIZE': reset_screen_size() elif self.mode.has_input_prompt and key == 'KEY_BACKSPACE': self.input_ = self.input_[:-1] - elif self.mode.has_input_prompt and key == '\n' and self.input_ == ''\ - and self.mode.name in {'chat', 'command_thing', 'take_thing', - 'drop_thing', 'admin_enter'}: - if self.mode.name != 'chat': + elif (((not self.mode.is_intro) and keycode == 27) # Escape + or (self.mode.has_input_prompt and key == '\n' + and self.input_ == ''\ + and self.mode.name in {'chat', 'command_thing', + 'take_thing', 'drop_thing', + 'admin_enter'})): + if self.mode.name not in {'chat', 'play', 'study', 'edit'}: self.log_msg('@ aborted') self.switch_mode('play') elif self.mode.has_input_prompt and key == '\n' and self.input_ == '/help':