So I'm trying to write a python program that simulates a right mouse click whenever I scroll with the mouse. I tried using pynput, and this is what I have:
from pynput.mouse import Button, Controller, Listener
mouse = Controller()
def on_scroll(x, y, dx, dy):
mouse.click(Button.left)
print('Scrolled {0}'.format(
(x, y)))
with Listener(
on_scroll=on_scroll) as listener:
listener.join()
Every time I run this program and scroll, my computer starts lagging, and my mouse as well. Then, I have to force shut down my computer because of the lag. What should I do?
Thank you in advance!