import pyautogui
import time
time.sleep(3)
pyautogui.moveTo(100, 100)
这将在显示器上沿100像素向下移动鼠标至100像素。其他例子:
# To make it drag along the screen
# (x, y, time taken)
pyautogui.moveTo(100, 100, 5)
# To make it hold while moving
# The 5 slows it
pyautogui.dragTo(100, 100, 5)
# To check if the next move pos is on display
# This will return false
pyautogui.onScreen(0, -1)
# To Move only x/y
pyautogui.moveTo(None, 500)
不要以相对方式移动,而是移动到显示器的固定点,例如:
这将在显示器上沿100像素向下移动鼠标至100像素。其他例子:
尽管pyautogui应该只向像素方向移动,而不考虑DPI,所以请附上您的代码
相关问题 更多 >
编程相关推荐