Guest User

Untitled

a guest
Dec 18th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. def mouseClickReally(width,high):
  2. win32api.SetCursorPos([int(width),int(high)])
  3. time.sleep(0.5)
  4. # 执行左单键击,若需要双击则延时几毫秒再点击一次即可
  5. win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  6. time.sleep(0.05)
  7. win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  8.  
  9. def left_click(hwd, x_position, y_position):
  10. long_position = win32api.MAKELONG(x_position, y_position)
  11. win32gui.PostMessage(hwd, win32con.WM_LBUTTONDOWN, win32con.MK_LBUTTON, long_position)
  12. win32api.PostMessage(hwd, win32con.WM_LBUTTONUP, win32con.MK_LBUTTON, long_position)
Add Comment
Please, Sign In to add comment