check if back is pressed python

40

import keyboard
while true:
    try:
        if keyboard.is_pressed('s'):
            print("stop")
        elif keyboard.is_pressed('p'):
            print("pause")
    except:
        pass

Comments

Submit
0 Comments