简体   繁体   English

在 Python 或 Windows 上的节点中模拟真实的鼠标点击?

[英]Simulate real mouse click in Python or Node on Windows?

Currently I'm developing a auto-clicker for an application, but somehow it's blocking the clicks that's coming from scripts.目前我正在为应用程序开发一个自动点击器,但它以某种方式阻止了来自脚本的点击。

Currently I'm trying to achieve a simple click on the screen, such as:目前我正在尝试实现在屏幕上的简单点击,例如:

import { mouseClick, moveMouse } from 'robotjs';

moveMouse(372, 404);
mouseClick('left');

Or in Python that I tried as well:或者在我也试过的 Python 中:

import pyautogui

pyautogui.click(372, 404)

Currently I tried those libs, but no luck at all, the window of the application is not even getting focused.目前我尝试了这些库,但一点运气都没有,应用程序的 window 甚至没有得到关注。

Found the issue, basically you must run the application as admin if the program that you wanna click is runned as admin, complete missed that.发现问题,基本上你必须以管理员身份运行应用程序,如果你想点击的程序是以管理员身份运行的,完全错过了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM