home · contact · privacy
In clients, show text input cursor.
authorChristian Heller <c.heller@plomlompom.de>
Mon, 14 Dec 2020 21:37:21 +0000 (22:37 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 14 Dec 2020 21:37:21 +0000 (22:37 +0100)
rogue_chat.html
rogue_chat_curses.py

index 31a85a56d3d45e787b7f6d11f92b9fc6ecdac4df..26e6bf802f91389628bb286db555c2f64ca70a12 100644 (file)
@@ -970,7 +970,7 @@ let tui = {
   recalc_input_lines: function() {
       if (this.mode.has_input_prompt) {
           let _ = null;
-          [this.input_lines, _] = this.msg_into_lines_of_width(this.input_prompt + this.inputEl.value, this.window_width);
+          [this.input_lines, _] = this.msg_into_lines_of_width(this.input_prompt + this.inputEl.value + '█', this.window_width);
       } else {
           this.input_lines = [];
       }
@@ -1554,7 +1554,7 @@ document.onclick = function() {
 };
 tui.inputEl.addEventListener('keydown', (event) => {
     tui.show_help = false;
-    if (event.key == 'Enter') {
+    if (['Enter', 'ArrowLeft', 'ArrowRight'].includes(event.key)) {
         event.preventDefault();
     }
     if ((!tui.mode.is_intro && event.key == 'Escape')
index 8eec3f6fe5865955eb74d5a210ed780c06769671..07c8697fc71d160cf63d9f43914f2d1ed64d58ec 100755 (executable)
@@ -885,7 +885,8 @@ class TUI:
             if not self.mode.has_input_prompt:
                 self.input_lines = []
             else:
-                self.input_lines = msg_into_lines_of_width(input_prompt + self.input_,
+                self.input_lines = msg_into_lines_of_width(input_prompt
+                                                           + self.input_ + '█',
                                                            self.window_width)
 
         def move_explorer(direction):