- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmouseEvents.py
More file actions
Latest commit
32 lines (25 loc) · 689 Bytes
/
Copy pathmouseEvents.py
File metadata and controls
32 lines (25 loc) · 689 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
__author__='Colby'
importtime
importwin32api, win32con
x_pad=361
y_pad=344
defleftClick():
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0)
time.sleep(0.1)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,0 ,0)
print("Click")
defleftDown():
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0)
time.sleep(.1)
print("left down")
defleftUp():
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,0 ,0)
time.sleep(.1)
print("left release")
defmousePos(cord):
win32api.SetCursorPos((x_pad+cord[0], y_pad+cord[1]))
defgetCords():
x, y=win32api.GetCursorPos()
x=x-x_pad
y=y-y_pad
print(x, y)