So I tried to simulate multiple mouse left click whenever I press the mouse's left button.However, my mouse start teleporting/moving slowly whenever I run my code. I am actually running this code with pycharm IDE.
I thought that maybe I am sending too much command per mouse press, so I decided to add a sleep between each click, to see the behavior. Unfortunately, the program still behave the same way.
from pynput.mouse import Listener,Controller, Button
import time
mouse = Controller()
def on_click(x, y, button, pressed):
if pressed and button == Button.left:
mouse.click(Button.right,2)
time.sleep(2)
print("stop")
with Listener( on_click=on_click) as listener:
listener.join()
I know that the code is not completed yet, but my final goal would be to simulate multiple click, with an interval of ~0.05 second, while I hold the mouse's left button.
Thank you,