-
Notifications
You must be signed in to change notification settings - Fork 0
/
bim_auto_sw.py
58 lines (41 loc) · 1.35 KB
/
bim_auto_sw.py
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import bim_auto_base as bim
# 被按住的鼠标键(左键LEFT、右键RIGHT、中键滚轮MIDDLE)
button = bim.MouseKey.MIDDLE
key = bim.KeyboardKey.SHIFT
def hot_key_down():
bim.left_corner_click()
bim.center_pos_click()
# bim.key_press(key)
bim.mouse_press(button)
def hot_key_release():
# bim.key_release(key)
bim.mouse_release(button)
def mouse_rotate():
"""鼠标按住后花圈"""
hot_key_down()
bim.mouse_scroll_and_drag(scroll_type=bim.ScrollType.CIRCLE)
hot_key_release()
def mouse_scroll_right_left():
"""鼠标按住向右拖动"""
hot_key_down()
bim.mouse_scroll_and_drag(scroll_type=bim.ScrollType.HOR_SCROLL_RIGHT)
bim.mouse_scroll_and_drag(scroll_type=bim.ScrollType.HOR_SCROLL_LEFT)
hot_key_release()
def mouse_scroll_down_up():
"""鼠标按住后向下拖动"""
hot_key_down()
bim.mouse_scroll_and_drag(scroll_type=bim.ScrollType.VER_SCROLL_DOWN)
bim.mouse_scroll_and_drag(scroll_type=bim.ScrollType.VER_SCROLL_UP)
hot_key_release()
def zoom_in_out():
"""鼠标滚轮缩放"""
bim.center_pos_click()
bim.mouse_zoom()
def test_run():
# zoom_in_out()
mouse_scroll_right_left()
mouse_scroll_down_up()
mouse_rotate()
if __name__ == '__main__':
for i in range(2):
test_run()