Map empty Enter to ZSCII 13 in read_char
MudInputStream.read_char() returned 0 for empty input, which no game recognizes as a valid keypress. Now returns 13 (Enter/Return) so "press any key" prompts like Curses' intro work from a MUD client.
This commit is contained in:
parent
fd977b91a2
commit
c8d9bdfae9
1 changed files with 3 additions and 1 deletions
|
|
@ -107,7 +107,9 @@ class MudInputStream(zstream.ZInputStream):
|
|||
text = self._input_queue.get()
|
||||
if text:
|
||||
return ord(text[0])
|
||||
return 0
|
||||
# Player hit Enter with no text — return 13 (ZSCII Enter/Return)
|
||||
# so "press any key" prompts work in a line-oriented MUD client.
|
||||
return 13
|
||||
|
||||
def feed(self, text: str):
|
||||
self._input_queue.put(text)
|
||||
|
|
|
|||
Loading…
Reference in a new issue