Answers for "how to do key sensing in python"

1

how to do key sensing in python

import keyboard, time

# Continuously check if 'c' key is pressed

while True:
  if keyboard.is_pressed('c'):
    print('The c key was pressed')
Posted by: Guest on January-03-2021

Python Answers by Framework

Browse Popular Code Answers by Language