Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import ctypes
- MOUSEEVENTF_MOVE = 0x0001 # mouse move
- MOUSEEVENTF_ABSOLUTE = 0x8000 # absolute move
- MOUSEEVENTF_MOVEABS = MOUSEEVENTF_MOVE + MOUSEEVENTF_ABSOLUTE
- MOUSEEVENTF_LEFTDOWN = 0x0002 # left button down
- MOUSEEVENTF_LEFTUP = 0x0004 # left button up
- MOUSEEVENTF_CLICK = MOUSEEVENTF_LEFTDOWN + MOUSEEVENTF_LEFTUP
- def click(x, y):
- x = 65536L * x / ctypes.windll.user32.GetSystemMetrics(0) + 1
- y = 65536L * y / ctypes.windll.user32.GetSystemMetrics(1) + 1
- ctypes.windll.user32.mouse_event(MOUSEEVENTF_MOVEABS, x, y, 0, 0)
- ctypes.windll.user32.mouse_event(MOUSEEVENTF_CLICK, 0, 0, 0, 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement