vial/src/main/python/linux_keystroke_recorder.py

18 lines
266 B
Python
Raw Normal View History

import sys
import keyboard
def key_cb(key):
print(key)
def linux_keystroke_recorder():
keyboard.hook(key_cb)
print("Recording")
while True:
ch = sys.stdin.read(1)
if ch == "q":
keyboard.unhook_all()
break