let chat = {
input_line:"",
- history: ["contain whitespace, escape them with \\.",
+ history: ["visible ASCII char in the input prompt.",
+ "To write on the map, enter on a single",
+ "contain whitespace, escape them with \\.",
"Use double quotes for strings that",
"Use arrow keys to move your avatar.",
" QUERY USER TEXT - send TEXT to USER",
chat.input_line = chat.input_line.slice(0, -1);
tui.draw_input_line();
} else if (event.key === 'Enter') {
- websocket.send(chat.input_line);
- chat.input_line = ''
+ if (chat.input_line.length === 1) {
+ websocket.send("TASK:WRITE " + chat.input_line);
+ } else {
+ websocket.send(chat.input_line);
+ }
+ chat.input_line = '';
tui.draw_input_line();
} else if (event.key === 'ArrowLeft') {
websocket.send('TASK:MOVE LEFT');
} else if (event.key === 'ArrowDown') {
websocket.send('TASK:MOVE DOWN');
};
- console.log(event.key);
}, false);
let websocket = new WebSocket(websocket_location);