fix backspace
This commit is contained in:
parent
5bbd7372d1
commit
9b7e96ed6b
|
@ -95,6 +95,10 @@ class KeycodeHandler:
|
|||
if byte == ESC_CHAR:
|
||||
self.esc = True
|
||||
return b""
|
||||
# i'm not super sure why this translation is necessary
|
||||
# idk if there's more translations that are necessary too
|
||||
elif byte == b"\x7f":
|
||||
return b"\x08"
|
||||
|
||||
return byte
|
||||
|
||||
|
@ -169,9 +173,15 @@ async def megacom_main(stdin: asyncio.StreamReader, stdout: asyncio.StreamWriter
|
|||
if len(c) == 0:
|
||||
continue
|
||||
|
||||
c = keycodes.process(c)
|
||||
if len(c) == 0:
|
||||
continue
|
||||
if ctrl:
|
||||
# stdout.write(f"\r\nin char: {c}\r\n".encode())
|
||||
# await stdout.drain()
|
||||
c = keycodes.process(c)
|
||||
if len(c) == 0:
|
||||
continue
|
||||
# else:
|
||||
# stdout.write(f"\r\nout char: {c}\r\n".encode())
|
||||
# await stdout.drain()
|
||||
|
||||
pout.write(c)
|
||||
await pout.drain()
|
||||
|
|
Loading…
Reference in New Issue