if keyboard is pressed

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

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
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'")