From 9209d0e0f1bbc79f872ce3b2bd353f1307a7c84d Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Tue, 27 Oct 2020 02:08:01 +0100
Subject: [PATCH] Allow space char for TASK:WRITE.

---
 new2/plomrogue/game.py                   | 2 +-
 new2/rogue_chat_nocanvas_monochrome.html | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/new2/plomrogue/game.py b/new2/plomrogue/game.py
index 52e0d60..8fb2644 100755
--- a/new2/plomrogue/game.py
+++ b/new2/plomrogue/game.py
@@ -71,7 +71,7 @@ class Game(GameBase):
             return self.map_geometry.get_directions()
         if string_option_type == 'char':
             return [c for c in
-                    string.digits + string.ascii_letters + string.punctuation]
+                    string.digits + string.ascii_letters + string.punctuation + ' ']
         return None
 
     def send_gamestate(self, connection_id=None):
diff --git a/new2/rogue_chat_nocanvas_monochrome.html b/new2/rogue_chat_nocanvas_monochrome.html
index fee0aa9..b49aac4 100644
--- a/new2/rogue_chat_nocanvas_monochrome.html
+++ b/new2/rogue_chat_nocanvas_monochrome.html
@@ -327,7 +327,7 @@ document.addEventListener('keydown', (event) => {
           };
     } else if (mode == 'edit') {
         if (event.key.length === 1) {
-            websocket.send("TASK:WRITE " + event.key);
+            websocket.send("TASK:WRITE " + quote(event.key));
         }
         mode = 'game';
     }
-- 
2.30.2