autoxkit 2.4.3__tar.gz → 2.4.5__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.4.3 → autoxkit-2.4.5}/PKG-INFO +1 -1
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit/hook/hook_listener.py +14 -14
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit.egg-info/PKG-INFO +1 -1
- {autoxkit-2.4.3 → autoxkit-2.4.5}/pyproject.toml +1 -1
- {autoxkit-2.4.3 → autoxkit-2.4.5}/LICENSE.txt +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/README.md +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit/__init__.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit/android/__init__.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit/android/adb.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit/android/binary.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit/android/client.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit/android/control.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit/android/control_backup.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit/android/models.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit/android/streams.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit/constants.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit/hook/__init__.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit/hook/event.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit/hook/hotkey_listener.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit/match/__init__.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit/match/match.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit/mousekey/__init__.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit/mousekey/input.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit/mousekey/keyboard.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit/mousekey/mouse.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit/utils.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit/window/__init__.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit/window/window.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit/window/window_action.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit/window/window_match.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit.egg-info/SOURCES.txt +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit.egg-info/dependency_links.txt +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit.egg-info/requires.txt +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/autoxkit.egg-info/top_level.txt +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.5}/setup.cfg +0 -0
|
@@ -64,6 +64,10 @@ user32.TranslateMessage.argtypes = [POINTER(wintypes.MSG)]
|
|
|
64
64
|
user32.TranslateMessage.restype = wintypes.BOOL
|
|
65
65
|
user32.DispatchMessageW.argtypes = [POINTER(wintypes.MSG)]
|
|
66
66
|
user32.DispatchMessageW.restype = ctypes.c_long
|
|
67
|
+
user32.GetMessageW.argtypes = [POINTER(wintypes.MSG), wintypes.HWND, wintypes.UINT, wintypes.UINT]
|
|
68
|
+
user32.GetMessageW.restype = wintypes.BOOL
|
|
69
|
+
user32.PostThreadMessageW.argtypes = [wintypes.DWORD, wintypes.UINT, wintypes.WPARAM, wintypes.LPARAM]
|
|
70
|
+
user32.PostThreadMessageW.restype = wintypes.BOOL
|
|
67
71
|
|
|
68
72
|
# ---------- HookListener 类 ----------
|
|
69
73
|
class HookListener:
|
|
@@ -198,6 +202,8 @@ class HookListener:
|
|
|
198
202
|
x, y = ms.pt.x, ms.pt.y
|
|
199
203
|
|
|
200
204
|
if wParam == 0x0200: # WM_MOUSEMOVE
|
|
205
|
+
if not self._on_mousemove:
|
|
206
|
+
return user32.CallNextHookEx(self.mouse_hook, nCode, wParam, lParam)
|
|
201
207
|
event = MouseEvent("MouseMove", None, x, y)
|
|
202
208
|
for cb in self._on_mousemove:
|
|
203
209
|
try:
|
|
@@ -309,8 +315,9 @@ class HookListener:
|
|
|
309
315
|
# 停止监听并取消钩子
|
|
310
316
|
def stop(self):
|
|
311
317
|
self._stop_event.set()
|
|
312
|
-
#
|
|
318
|
+
# 发送 WM_QUIT 消息唤醒 GetMessageW 阻塞
|
|
313
319
|
if self._thread and self._thread.is_alive():
|
|
320
|
+
user32.PostThreadMessageW(self._thread.ident, 0x0012, 0, 0)
|
|
314
321
|
self._thread.join(timeout=1.0)
|
|
315
322
|
# 尝试取消钩子(若尚未取消)
|
|
316
323
|
if self.keyboard_hook:
|
|
@@ -342,19 +349,12 @@ class HookListener:
|
|
|
342
349
|
return
|
|
343
350
|
|
|
344
351
|
msg = wintypes.MSG()
|
|
345
|
-
while
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
else:
|
|
352
|
-
# 无消息时休眠,避免 CPU 忙等
|
|
353
|
-
time.sleep(MSG_POLL_INTERVAL)
|
|
354
|
-
except Exception:
|
|
355
|
-
# 记录异常但不退出循环,确保钩子持续工作
|
|
356
|
-
print("[hook_listener] Exception in message pump", file=__import__('sys').stderr)
|
|
357
|
-
continue
|
|
352
|
+
while True:
|
|
353
|
+
ret = user32.GetMessageW(byref(msg), 0, 0, 0)
|
|
354
|
+
if ret <= 0:
|
|
355
|
+
break
|
|
356
|
+
user32.TranslateMessage(byref(msg))
|
|
357
|
+
user32.DispatchMessageW(byref(msg))
|
|
358
358
|
|
|
359
359
|
# 离开循环之前确保取消钩子
|
|
360
360
|
if self.keyboard_hook:
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "autoxkit"
|
|
7
|
-
version = "2.4.
|
|
7
|
+
version = "2.4.5"
|
|
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
|
|
File without changes
|
|
File without changes
|