X-Git-Url: https://plomlompom.com/repos/berlin_corona.txt?a=blobdiff_plain;f=rogue_chat.html;h=ebe64f2041fe4a4f755da1bea1a670185c23cdc2;hb=1750783da9cd6fd4f80d6484a3b714c352eef126;hp=c871b6a8f48eba02a27f7283c1922733211468b7;hpb=8477309adb13b14ea254d08c4ab81f46a0a29392;p=plomrogue2 diff --git a/rogue_chat.html b/rogue_chat.html index c871b6a..ebe64f2 100644 --- a/rogue_chat.html +++ b/rogue_chat.html @@ -1472,11 +1472,12 @@ tui.inputEl.addEventListener('keydown', (event) => { if (event.key == 'Enter') { event.preventDefault(); } - if (tui.mode.has_input_prompt && event.key == 'Enter' - && tui.inputEl.value.length == 0 - && ['chat', 'command_thing', 'take_thing', 'drop_thing', - 'admin_enter'].includes(tui.mode.name)) { - if (tui.mode.name != 'chat') { + if ((!tui.mode.is_intro && event.key == 'Escape') + || (tui.mode.has_input_prompt && event.key == 'Enter' + && tui.inputEl.value.length == 0 + && ['chat', 'command_thing', 'take_thing', 'drop_thing', + 'admin_enter'].includes(tui.mode.name))) { + if (!['chat', 'play', 'study', 'edit'].includes(tui.mode.name)) { tui.log_msg('@ aborted'); } tui.switch_mode('play');