fix backspace
This commit is contained in:
parent
5bbd7372d1
commit
9b7e96ed6b
|
@ -95,6 +95,10 @@ class KeycodeHandler:
|
||||||
if byte == ESC_CHAR:
|
if byte == ESC_CHAR:
|
||||||
self.esc = True
|
self.esc = True
|
||||||
return b""
|
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
|
return byte
|
||||||
|
|
||||||
|
@ -169,9 +173,15 @@ async def megacom_main(stdin: asyncio.StreamReader, stdout: asyncio.StreamWriter
|
||||||
if len(c) == 0:
|
if len(c) == 0:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
c = keycodes.process(c)
|
if ctrl:
|
||||||
if len(c) == 0:
|
# stdout.write(f"\r\nin char: {c}\r\n".encode())
|
||||||
continue
|
# 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)
|
pout.write(c)
|
||||||
await pout.drain()
|
await pout.drain()
|
||||||
|
|
Loading…
Reference in New Issue