def _click(x, y):
handle = win32gui.GetForegroundWindow()
x_old, y_old = win32api.GetCursorPos()
# see https://github.com/asweigart/pyautogui/issues/23
try:
pyautogui.click(x, y, 1)
except FileNotFoundError:
pass
win32api.SetCursorPos((x_old, y_old))
win32gui.SetForegroundWindow(handle)
评论列表
文章目录