Code: Select all
import keyboard
import threading
def spam_this():
status = 0
while True:
if keyboard.is_pressed("F9") and status == 0:
status = 1
event.wait(1)
if keyboard.is_pressed("F9") and status == 1:
status = 0
event.wait(1)
while status == 1:
if keyboard.is_pressed("F9") and status == 1:
status = 0
event.wait(1)
print("test")
event = threading.Event()
threading.Thread(target=spam_this).start()
< /code>
Das obige Skript funktioniert perfekt. Wenn ich jedoch den Zeilendruck ("Test")
Code: Select all
import keyboard
import threading
def spam_this():
status = 0
while True:
if keyboard.is_pressed("F9") and status == 0:
status = 1
event.wait(1)
if keyboard.is_pressed("F9") and status == 1:
status = 0
event.wait(1)
while status == 1:
if keyboard.is_pressed("F9") and status == 1:
status = 0
event.wait(1)
keyboard.write("test")
event = threading.Event()
threading.Thread(target=spam_this).start()