I am working on a little Mouse Spamming Stopper script in Python and I don't really know how can I only block the mouse click, but still be able to move the mouse.
This is what I got so far:
from pynput.mouse import Listener
import time
mouse_allowed = True
def timeout():
mouse_allowed = False
time.sleep(0.1)
def on_click(x, y, button, pressed):
if mouse_allowed:
print("Clicked")
timeout()
if mouse_allowed:
with Listener(on_click=on_click) as listener:
listener.join()