from sshkeyboard import listen_keyboard
def press(key):
print(f"'{key}' pressed")
def release(key):
print(f"'{key}' released")
listen_keyboard(
on_press=press,
on_release=release,
)
When above code runs from command prompt, only keystrokes entered on command prompt are detected. Keystrokes typed on any other applications like chrome, vscode etc.. are not detected.
When above code runs from command prompt, only keystrokes entered on command prompt are detected. Keystrokes typed on any other applications like chrome, vscode etc.. are not detected.