简体   繁体   中英

Pyautogui click not clicking properly

in this code:

temp = None
while temp == None:
    temp = pyautogui.locateOnScreen("Play_Button.PNG")

play_buttonx, play_buttony = pyautogui.center(temp)

pyautogui.click(play_buttonx, play_buttony, duration = 0.3)

The pointer heads to the center of the button and stops!

I tried the win32api + win32con, still it didn't work, I tried setting "clicks" to a different number, changing intervals, etc..., yet nothing works, once I touch my mousepad the button is clicked and the game starts...

显然游戏检测到注入的鼠标点击和按键,所以我需要绕过注入的标志。

尝试用pyautogui.click(play_buttonx, play_buttonny, clicks = 2, duration = 0.3)替换pyautogui.click(play_buttonx, play_buttony, duration = 0.3)第一次点击应该让python选择窗口然后第二次点击应该实际点击按钮。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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