Mar-26-2022, 03:11 PM
I'm trying to create a simple autoclicker where when I hold down on caps lock, the mouse will left click over and over again. I wrote a simple program that works well on my Mac, but on a Windows 10 computer it won't work. The code works fine when I just print something out while I'm holding down caps lock, but when I make it click while doing that, nothing happens. I'm running it on Visual Studio with Python 3. I'm pretty sure that pynput works well with Windows 10, so I'm confused about the problem. Thanks!
Here is my code:
Here is my code:
import keyboard
import time
from pynput.mouse import Button, Controller
mouse = Controller()
toggle = False
while True:
if keyboard.is_pressed('caps_lock'):
mouse.click(Button.left, 1)
time.sleep(0.04)
