Answers for "python pynput letter key pressed"

0

python pynput letter key pressed

from pynput import keyboard

def on_press(key):
    if key.char == 'a': # here you can choose the letter you want to get detected
        print("You pressed A")

with keyboard.Listener(on_press=on_press) as listener:
    listener.join()
Posted by: Guest on June-23-2021

Python Answers by Framework

Browse Popular Code Answers by Language