该程序检测到自己的点击,以便停止

发布于 2025-01-29 14:17:19 字数 260 浏览 3 评论 0原文

尝试制作一个仅在按下左键鼠标按钮时单击的自动化器。不幸的是,该程序本身检测到该按钮已发布,因此我停止单击。是否有任何选项可以检查程序或鼠标是否单击?还是使它起作用?我对将按钮更改为另一个不感兴趣。仅左鼠标按钮。

import mouse
import time

while True:
    time.sleep(0.01)
    while mouse.is_pressed("left"):
        mouse.click('left')

Trying to make an autoclicker that clicks only when the left mouse button is pressed. Unfortunately the program itself detects that the button has been released so I stop clicking. Is there any option to check if program or mouse is clicking? Or to make it work? I am not interested in changing button to another one. Only left mouse button.

import mouse
import time

while True:
    time.sleep(0.01)
    while mouse.is_pressed("left"):
        mouse.click('left')

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

黑白记忆 2025-02-05 14:17:19

我找到了解决方案

import time, pyautogui, win32api
import win32api, win32con

while True:
    time.sleep(0.076)
    if win32api.GetKeyState(0x01)<0:
        win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,0,0)

i found the solution

import time, pyautogui, win32api
import win32api, win32con

while True:
    time.sleep(0.076)
    if win32api.GetKeyState(0x01)<0:
        win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,0,0)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文