Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def mouseClickReally(width,high):
- win32api.SetCursorPos([int(width),int(high)])
- time.sleep(0.5)
- # 执行左单键击,若需要双击则延时几毫秒再点击一次即可
- win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
- time.sleep(0.05)
- win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
- def left_click(hwd, x_position, y_position):
- long_position = win32api.MAKELONG(x_position, y_position)
- win32gui.PostMessage(hwd, win32con.WM_LBUTTONDOWN, win32con.MK_LBUTTON, long_position)
- win32api.PostMessage(hwd, win32con.WM_LBUTTONUP, win32con.MK_LBUTTON, long_position)
Add Comment
Please, Sign In to add comment