home · contact · privacy
Fix minor keybinding bug in web client.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 8 Nov 2020 01:43:04 +0000 (02:43 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 8 Nov 2020 01:43:04 +0000 (02:43 +0100)
new2/rogue_chat_nocanvas_monochrome.html

index b51fc019c3fe859219d38f32ce6b90f6bc3a1e7d..ab3ce34b1a65df612a176204f24f0dc09823f1fa 100644 (file)
@@ -708,9 +708,9 @@ tui.inputEl.addEventListener('keydown', (event) => {
         let [tokens, token_starts] = parser.tokenize(tui.inputEl.value);
         if (tokens.length > 0 && tokens[0].length > 0) {
             if (tui.inputEl.value[0][0] == '/') {
-                if (tokens[0].slice(1) == 'play' || tokens[0].slice(1) == 'P') {
+                if (tokens[0].slice(1) == 'play' || tokens[0][1] == tui.keys.switch_to_play) {
                     tui.switch_mode(mode_play);
-                } else if (tokens[0].slice(1) == 'study' || tokens[0].slice(1) == '?') {
+                } else if (tokens[0].slice(1) == 'study' || tokens[0][1] == tui.keys.switch_to_study) {
                     tui.switch_mode(mode_study);
                 } else if (tokens[0].slice(1) == 'help') {
                     tui.log_help();