how do I trigger the mouse being clicked rapidly when a key is held down (shift key in this instance). My code is currently
import win32api
import win32con
import time
from pynput.mouse import Button, Controller
mouse = Controller()
while True:
keystate = win32api.GetAsyncKeyState(0x10)
if keystate < 0:
mouse.click(Button.left, 2)
else:
pass
The issue I'm having is everytime I actually press the shift key the program crashes. When printing out the keystate it shows 0 until shift is pressed in which it shows -32767 and then it stops printing and I have to kill the process. How do I stop this from happening.