From 23a3f6f5cabc3910f2f81a75473305658e9b0ddd Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Thu, 21 Nov 2019 23:45:28 +1100 Subject: [PATCH] Add leading zeroes to xdotool to force interpretation as keycodes Fixes bug where e.g. Escape would be interpreted as the number 9 --- forward.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/forward.py b/forward.py index 5ffe1d0..1d259f4 100755 --- a/forward.py +++ b/forward.py @@ -98,7 +98,8 @@ async def keyboardinp(): sys.exit(0) return - print('DISPLAY=:0 xdotool keydown {}'.format(button)) + # Add leading 0 to force interpretation as key code + print('DISPLAY=:0 xdotool keydown 0{}'.format(button)) elif line.startswith('key release'): print(line, file=sys.stderr) button = line.split()[-1] @@ -106,7 +107,7 @@ async def keyboardinp(): if button == '37': is_ctrl = False - print('DISPLAY=:0 xdotool keyup {}'.format(button)) + print('DISPLAY=:0 xdotool keyup 0{}'.format(button)) async def main(): tasks = []