autoxkit 2.4.3__tar.gz → 2.4.4__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.4}/PKG-INFO +1 -1
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit/hook/hook_listener.py +12 -14
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit.egg-info/PKG-INFO +1 -1
- {autoxkit-2.4.3 → autoxkit-2.4.4}/pyproject.toml +1 -1
- {autoxkit-2.4.3 → autoxkit-2.4.4}/LICENSE.txt +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/README.md +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit/__init__.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit/android/__init__.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit/android/adb.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit/android/binary.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit/android/client.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit/android/control.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit/android/control_backup.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit/android/models.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit/android/streams.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit/constants.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit/hook/__init__.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit/hook/event.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit/hook/hotkey_listener.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit/match/__init__.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit/match/match.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit/mousekey/__init__.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit/mousekey/input.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit/mousekey/keyboard.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit/mousekey/mouse.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit/utils.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit/window/__init__.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit/window/window.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit/window/window_action.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit/window/window_match.py +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit.egg-info/SOURCES.txt +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit.egg-info/dependency_links.txt +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit.egg-info/requires.txt +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/autoxkit.egg-info/top_level.txt +0 -0
- {autoxkit-2.4.3 → autoxkit-2.4.4}/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:
|
|
@@ -309,8 +313,9 @@ class HookListener:
|
|
|
309
313
|
# 停止监听并取消钩子
|
|
310
314
|
def stop(self):
|
|
311
315
|
self._stop_event.set()
|
|
312
|
-
#
|
|
316
|
+
# 发送 WM_QUIT 消息唤醒 GetMessageW 阻塞
|
|
313
317
|
if self._thread and self._thread.is_alive():
|
|
318
|
+
user32.PostThreadMessageW(self._thread.ident, 0x0012, 0, 0)
|
|
314
319
|
self._thread.join(timeout=1.0)
|
|
315
320
|
# 尝试取消钩子(若尚未取消)
|
|
316
321
|
if self.keyboard_hook:
|
|
@@ -342,19 +347,12 @@ class HookListener:
|
|
|
342
347
|
return
|
|
343
348
|
|
|
344
349
|
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
|
|
350
|
+
while True:
|
|
351
|
+
ret = user32.GetMessageW(byref(msg), 0, 0, 0)
|
|
352
|
+
if ret <= 0:
|
|
353
|
+
break
|
|
354
|
+
user32.TranslateMessage(byref(msg))
|
|
355
|
+
user32.DispatchMessageW(byref(msg))
|
|
358
356
|
|
|
359
357
|
# 离开循环之前确保取消钩子
|
|
360
358
|
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.4"
|
|
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
|