if keyboard is pressed

Solutions on MaxInterview for if keyboard is pressed by the best coders in the world

showing results for - "if keyboard is pressed"
Sofia
06 Apr 2016
1# keyboard module
2# windows: pip install keyboard
3# mac: pip3 install keyboard
4
5import keyboard as k
6if k.is_pressed("a"):
7  # if the a key is pressed by the user
8  print("You have pressed the key 'a'")