英文:
Why is win32api.GetAsyncKeyState not a global hotkey?
问题
我正在尝试制作一个可以自动将鼠标移动到特定位置的机器人。唯一的问题是现在该函数不再是全局的,但原因不明。
英文:
I'm trying to make a bot that automatically moves the mouse to a specific location. Only problem now is that the function was global, but now isn't anymore for some reason.
import mouse
import configparser
import win32api
hexstring = config.get("keypress", "keypress")
an_int = int(hexstring, 16)
if win32api.GetAsyncKeyState(an_int) < 0:
mouse._os_mouse.move_relative(int(xcoord), int(ycoord))
答案1
得分: -1
我找到了错误。我只需要以管理员身份打开该应用程序。
英文:
I found the error. I just needed to open the application as an administrator.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论