diff --git a/js/game.js b/js/game.js index 90df9b0..9896c8a 100644 --- a/js/game.js +++ b/js/game.js @@ -42,6 +42,7 @@ function initKeyboardBridge() { const line = buffer; buffer = ""; InputModule.submitLocal(line); + InputModule.updateLocalDisplay(""); } else if (e.key === "Escape") { buffer = ""; InputModule.clear(); diff --git a/js/input.js b/js/input.js index aded464..6b33172 100644 --- a/js/input.js +++ b/js/input.js @@ -3,7 +3,7 @@ const InputModule = { localBuffer: "", submitLine(text, username) { - const line = text.trim().toLowerCase(); + const line = text.trim().toLowerCase().split(/\s+/)[0]; if (!line) return; if (introPlaying) return; @@ -25,7 +25,7 @@ const InputModule = { }, submitLocal(text) { - const line = text.trim().toLowerCase(); + const line = text.trim().toLowerCase().split(/\s+/)[0]; if (!line) return; if (introPlaying) return;