python-鼠标宏

2021-01-08 14:33

阅读:356

标签:col   port   ==   als   time   mouse   put   lag   imp   

按下鼠标左键, 连击

按下鼠标右键, 停止

import win32api
import time
from pynput.mouse import Button, Controller
mouse = Controller()

while True:

    if (win32api.GetAsyncKeyState(0x01)&0x8000 > 0):
        flag = True
        while flag == True:
               mouse.click(Button.left, 1)
               time.sleep(0.1)
               if (win32api.GetAsyncKeyState(0x02)&0x8000 > 0):
                   flag = False
    else:
        pass

 

python-鼠标宏

标签:col   port   ==   als   time   mouse   put   lag   imp   

原文地址:https://www.cnblogs.com/strive-sun/p/12967022.html


评论


亲,登录后才可以留言!