Answers for "if keyboard.is_pressed"

0

if keyboard.is_pressed

# keyboard module
# windows: pip install keyboard
# mac: pip3 install keyboard

import keyboard as k
if k.is_pressed("a"):
  # if the a key is pressed by the user
  print("You have pressed the key 'a'")
Posted by: Guest on February-01-2021

Python Answers by Framework

Browse Popular Code Answers by Language