Я пытаюсь создать сценарий, чтобы при нажатии z одновременно имитировались нажатия клавиш shift и ctrl.Как бы я поступил так?
Всякий раз, когда запускается код, это приводит к исключению.
t1 = threading.Thread(target=sprint, args=() )
t2 = threading.Thread(target=crouch, args=() )
while True:
try:
while keyboard.is_pressed('z'):
t1.start()
t2.start()
t1.join()
t2.join()
else:
continue
except:
print "error"
break
'''
I expect the that when the z key is pressed the sprint and crouch functions will loop. Currently it goes straight to the exception.