1
Fork 0

Add leading zeroes to xdotool to force interpretation as keycodes

Fixes bug where e.g. Escape would be interpreted as the number 9
This commit is contained in:
RunasSudo 2019-11-21 23:45:28 +11:00
parent 823bad796c
commit 23a3f6f5ca
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A
1 changed files with 3 additions and 2 deletions

View File

@ -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 = []