autoxkit 2.2.1__tar.gz → 2.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {autoxkit-2.2.1 → autoxkit-2.3.0}/PKG-INFO +8 -1
- {autoxkit-2.2.1 → autoxkit-2.3.0}/README.md +7 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit/hook/event.py +4 -4
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit/hook/hook_listener.py +16 -1
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit.egg-info/PKG-INFO +8 -1
- {autoxkit-2.2.1 → autoxkit-2.3.0}/pyproject.toml +1 -1
- {autoxkit-2.2.1 → autoxkit-2.3.0}/LICENSE.txt +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit/__init__.py +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit/android/__init__.py +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit/android/adb.py +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit/android/binary.py +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit/android/client.py +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit/android/control.py +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit/android/control_backup.py +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit/android/models.py +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit/android/streams.py +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit/constants.py +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit/hook/__init__.py +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit/hook/hotkey_listener.py +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit/match/__init__.py +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit/match/match.py +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit/mousekey/__init__.py +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit/mousekey/input.py +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit/mousekey/keyboard.py +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit/mousekey/mouse.py +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit/utils.py +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit/window/__init__.py +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit/window/window.py +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit/window/window_action.py +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit/window/window_match.py +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit.egg-info/SOURCES.txt +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit.egg-info/dependency_links.txt +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit.egg-info/requires.txt +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/autoxkit.egg-info/top_level.txt +0 -0
- {autoxkit-2.2.1 → autoxkit-2.3.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: autoxkit
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.0
|
|
4
4
|
Summary: Python library for Windows automation and Android device screen casting and control
|
|
5
5
|
Author-email: YorickFin <1582456060@qq.com>
|
|
6
6
|
License: GPL-3.0-or-later
|
|
@@ -91,11 +91,17 @@ def mouse_up(event: MouseEvent):
|
|
|
91
91
|
return False
|
|
92
92
|
|
|
93
93
|
|
|
94
|
+
def mouse_move(event: MouseEvent):
|
|
95
|
+
print(event.action, event.button, event.position)
|
|
96
|
+
return False
|
|
97
|
+
|
|
98
|
+
|
|
94
99
|
hook_listener = HookListener()
|
|
95
100
|
hook_listener.add_handler('keydown', key_down)
|
|
96
101
|
hook_listener.add_handler('keyup', key_up)
|
|
97
102
|
hook_listener.add_handler('mousedown', mouse_down)
|
|
98
103
|
hook_listener.add_handler('mouseup', mouse_up)
|
|
104
|
+
hook_listener.add_handler('mousemove', mouse_move)
|
|
99
105
|
hook_listener.start()
|
|
100
106
|
|
|
101
107
|
print("当前鼠标位置:", hook_listener.get_mouse_position())
|
|
@@ -105,6 +111,7 @@ if __name__ == '__main__':
|
|
|
105
111
|
hook_listener.wait()
|
|
106
112
|
except Exception:
|
|
107
113
|
hook_listener.stop()
|
|
114
|
+
|
|
108
115
|
```
|
|
109
116
|
|
|
110
117
|
更多示例代码请参考 [examples](examples)
|
|
@@ -68,11 +68,17 @@ def mouse_up(event: MouseEvent):
|
|
|
68
68
|
return False
|
|
69
69
|
|
|
70
70
|
|
|
71
|
+
def mouse_move(event: MouseEvent):
|
|
72
|
+
print(event.action, event.button, event.position)
|
|
73
|
+
return False
|
|
74
|
+
|
|
75
|
+
|
|
71
76
|
hook_listener = HookListener()
|
|
72
77
|
hook_listener.add_handler('keydown', key_down)
|
|
73
78
|
hook_listener.add_handler('keyup', key_up)
|
|
74
79
|
hook_listener.add_handler('mousedown', mouse_down)
|
|
75
80
|
hook_listener.add_handler('mouseup', mouse_up)
|
|
81
|
+
hook_listener.add_handler('mousemove', mouse_move)
|
|
76
82
|
hook_listener.start()
|
|
77
83
|
|
|
78
84
|
print("当前鼠标位置:", hook_listener.get_mouse_position())
|
|
@@ -82,6 +88,7 @@ if __name__ == '__main__':
|
|
|
82
88
|
hook_listener.wait()
|
|
83
89
|
except Exception:
|
|
84
90
|
hook_listener.stop()
|
|
91
|
+
|
|
85
92
|
```
|
|
86
93
|
|
|
87
94
|
更多示例代码请参考 [examples](examples)
|
|
@@ -21,13 +21,13 @@ class MouseEvent:
|
|
|
21
21
|
"""
|
|
22
22
|
鼠标事件
|
|
23
23
|
Args:
|
|
24
|
-
action (str): 事件类型,"MouseDown"
|
|
25
|
-
button (str): 鼠标按钮,"MLeft"、"MRight"、"MMiddle"、"
|
|
24
|
+
action (str): 事件类型,"MouseDown"、"MouseUp"或"MouseMove"
|
|
25
|
+
button (str): 鼠标按钮,"MLeft"、"MRight"、"MMiddle"、"MSide1"、"MSide2",MouseMove时为None
|
|
26
26
|
x (int): 鼠标x坐标
|
|
27
27
|
y (int): 鼠标y坐标
|
|
28
28
|
Attributes:
|
|
29
|
-
action (str): 事件类型,"MouseDown"
|
|
30
|
-
button (str): 鼠标按钮,"MLeft"、"MRight"、"MMiddle"、"
|
|
29
|
+
action (str): 事件类型,"MouseDown"、"MouseUp"或"MouseMove"
|
|
30
|
+
button (str): 鼠标按钮,"MLeft"、"MRight"、"MMiddle"、"MSide1"、"MSide2",MouseMove时为None
|
|
31
31
|
position (tuple): 鼠标位置,(x, y)格式
|
|
32
32
|
"""
|
|
33
33
|
def __init__(self, action, button, x, y):
|
|
@@ -76,6 +76,7 @@ class HookListener:
|
|
|
76
76
|
self._on_keyup = []
|
|
77
77
|
self._on_mousedown = []
|
|
78
78
|
self._on_mouseup = []
|
|
79
|
+
self._on_mousemove = []
|
|
79
80
|
|
|
80
81
|
# 钩子与线程状态
|
|
81
82
|
self._thread = None
|
|
@@ -110,6 +111,8 @@ class HookListener:
|
|
|
110
111
|
self._on_mousedown.append(func)
|
|
111
112
|
elif event_type == "mouseup":
|
|
112
113
|
self._on_mouseup.append(func)
|
|
114
|
+
elif event_type == "mousemove":
|
|
115
|
+
self._on_mousemove.append(func)
|
|
113
116
|
else:
|
|
114
117
|
raise ValueError("unknown event_type: " + str(event_type))
|
|
115
118
|
|
|
@@ -133,6 +136,8 @@ class HookListener:
|
|
|
133
136
|
target = self._on_mousedown
|
|
134
137
|
elif event_type == "mouseup":
|
|
135
138
|
target = self._on_mouseup
|
|
139
|
+
elif event_type == "mousemove":
|
|
140
|
+
target = self._on_mousemove
|
|
136
141
|
else:
|
|
137
142
|
raise ValueError("unknown event_type: " + str(event_type))
|
|
138
143
|
try:
|
|
@@ -192,7 +197,17 @@ class HookListener:
|
|
|
192
197
|
ms = ctypes.cast(lParam, POINTER(MSLLHOOKSTRUCT)).contents
|
|
193
198
|
x, y = ms.pt.x, ms.pt.y
|
|
194
199
|
|
|
195
|
-
if wParam
|
|
200
|
+
if wParam == 0x0200: # WM_MOUSEMOVE
|
|
201
|
+
event = MouseEvent("MouseMove", None, x, y)
|
|
202
|
+
for cb in self._on_mousemove:
|
|
203
|
+
try:
|
|
204
|
+
result = cb(event)
|
|
205
|
+
if result is True:
|
|
206
|
+
return 1 # 截断事件传播
|
|
207
|
+
except Exception as e:
|
|
208
|
+
print(f"[hook_listener] Exception in mousemove callback: {e}", file=__import__('sys').stderr)
|
|
209
|
+
|
|
210
|
+
elif wParam in (HHC["MLeftDown"], HHC["MRightDown"], HHC["MiddleDown"], HHC["XDown"]):
|
|
196
211
|
button = self._get_mouse_button(wParam, ms.mouseData)
|
|
197
212
|
event = MouseEvent("MouseDown", button, x, y)
|
|
198
213
|
for cb in self._on_mousedown:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: autoxkit
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.0
|
|
4
4
|
Summary: Python library for Windows automation and Android device screen casting and control
|
|
5
5
|
Author-email: YorickFin <1582456060@qq.com>
|
|
6
6
|
License: GPL-3.0-or-later
|
|
@@ -91,11 +91,17 @@ def mouse_up(event: MouseEvent):
|
|
|
91
91
|
return False
|
|
92
92
|
|
|
93
93
|
|
|
94
|
+
def mouse_move(event: MouseEvent):
|
|
95
|
+
print(event.action, event.button, event.position)
|
|
96
|
+
return False
|
|
97
|
+
|
|
98
|
+
|
|
94
99
|
hook_listener = HookListener()
|
|
95
100
|
hook_listener.add_handler('keydown', key_down)
|
|
96
101
|
hook_listener.add_handler('keyup', key_up)
|
|
97
102
|
hook_listener.add_handler('mousedown', mouse_down)
|
|
98
103
|
hook_listener.add_handler('mouseup', mouse_up)
|
|
104
|
+
hook_listener.add_handler('mousemove', mouse_move)
|
|
99
105
|
hook_listener.start()
|
|
100
106
|
|
|
101
107
|
print("当前鼠标位置:", hook_listener.get_mouse_position())
|
|
@@ -105,6 +111,7 @@ if __name__ == '__main__':
|
|
|
105
111
|
hook_listener.wait()
|
|
106
112
|
except Exception:
|
|
107
113
|
hook_listener.stop()
|
|
114
|
+
|
|
108
115
|
```
|
|
109
116
|
|
|
110
117
|
更多示例代码请参考 [examples](examples)
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "autoxkit"
|
|
7
|
-
version = "2.
|
|
7
|
+
version = "2.3.0"
|
|
8
8
|
description = "Python library for Windows automation and Android device screen casting and control"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|