Verifique se o traseiro está pressionado Python
import keyboard
while true:
try:
if keyboard.is_pressed('s'):
print("stop")
elif keyboard.is_pressed('p'):
print("pause")
except:
pass
TheProgrammer