SHARE
TWEET

Untitled

a guest Jan 24th, 2020 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import ctypes
  2. MOUSEEVENTF_MOVE = 0x0001 # mouse move
  3. MOUSEEVENTF_ABSOLUTE = 0x8000 # absolute move
  4. MOUSEEVENTF_MOVEABS = MOUSEEVENTF_MOVE + MOUSEEVENTF_ABSOLUTE
  5.  
  6. MOUSEEVENTF_LEFTDOWN = 0x0002 # left button down
  7. MOUSEEVENTF_LEFTUP = 0x0004 # left button up
  8. MOUSEEVENTF_CLICK = MOUSEEVENTF_LEFTDOWN + MOUSEEVENTF_LEFTUP
  9.  
  10. def click(x, y):
  11.     x = 65536L * x / ctypes.windll.user32.GetSystemMetrics(0) + 1
  12.     y = 65536L * y / ctypes.windll.user32.GetSystemMetrics(1) + 1
  13.     ctypes.windll.user32.mouse_event(MOUSEEVENTF_MOVEABS, x, y, 0, 0)
  14.     ctypes.windll.user32.mouse_event(MOUSEEVENTF_CLICK, 0, 0, 0, 0)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top