diff --git a/megacom/__init__.py b/megacom/__init__.py index ca39941..b54b220 100644 --- a/megacom/__init__.py +++ b/megacom/__init__.py @@ -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()