ascript 1.2.8__tar.gz → 1.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.
Files changed (280) hide show
  1. {ascript-1.2.8 → ascript-1.3.0}/PKG-INFO +2 -1
  2. ascript-1.3.0/ascript/windows/hardware/logitech_driver.py +126 -0
  3. ascript-1.3.0/ascript/windows/hardware/mouse.py +112 -0
  4. ascript-1.3.0/ascript/windows/resources/libs/logitech/x64/LogitechGkeyEnginesWrapper.dll +0 -0
  5. ascript-1.3.0/ascript/windows/resources/libs/logitech/x86/LogitechGkeyEnginesWrapper.dll +0 -0
  6. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/screen/__init__.py +0 -1
  7. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/screen/ocr/rapidocr_hook.py +1 -1
  8. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/screen/screen_core.py +0 -1
  9. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/system/r.py +20 -1
  10. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/colors_tool.cpython-312.pyc +0 -0
  11. ascript-1.3.0/ascript/windows/tools/__pycache__/dumptool.cpython-312.pyc +0 -0
  12. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/colors_tool.py +14 -11
  13. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/dumptool.py +13 -4
  14. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/ui/web_window.py +11 -5
  15. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/window/Window.py +46 -5
  16. {ascript-1.2.8 → ascript-1.3.0}/ascript.egg-info/PKG-INFO +2 -1
  17. {ascript-1.2.8 → ascript-1.3.0}/ascript.egg-info/SOURCES.txt +3 -0
  18. {ascript-1.2.8 → ascript-1.3.0}/ascript.egg-info/requires.txt +1 -0
  19. {ascript-1.2.8 → ascript-1.3.0}/pyproject.toml +2 -1
  20. ascript-1.2.8/ascript/windows/hardware/mouse.py +0 -130
  21. ascript-1.2.8/ascript/windows/tools/__pycache__/dumptool.cpython-312.pyc +0 -0
  22. {ascript-1.2.8 → ascript-1.3.0}/MANIFEST.in +0 -0
  23. {ascript-1.2.8 → ascript-1.3.0}/README.md +0 -0
  24. {ascript-1.2.8 → ascript-1.3.0}/ascript/__init__.py +0 -0
  25. {ascript-1.2.8 → ascript-1.3.0}/ascript/android/__init__.py +0 -0
  26. {ascript-1.2.8 → ascript-1.3.0}/ascript/android/action/__init__.py +0 -0
  27. {ascript-1.2.8 → ascript-1.3.0}/ascript/android/action/ashid.py +0 -0
  28. {ascript-1.2.8 → ascript-1.3.0}/ascript/android/cloud_control.py +0 -0
  29. {ascript-1.2.8 → ascript-1.3.0}/ascript/android/data.py +0 -0
  30. {ascript-1.2.8 → ascript-1.3.0}/ascript/android/media.py +0 -0
  31. {ascript-1.2.8 → ascript-1.3.0}/ascript/android/node.py +0 -0
  32. {ascript-1.2.8 → ascript-1.3.0}/ascript/android/plug.py +0 -0
  33. {ascript-1.2.8 → ascript-1.3.0}/ascript/android/screen/__init__.py +0 -0
  34. {ascript-1.2.8 → ascript-1.3.0}/ascript/android/screen/ascv.py +0 -0
  35. {ascript-1.2.8 → ascript-1.3.0}/ascript/android/screen/color_tools.py +0 -0
  36. {ascript-1.2.8 → ascript-1.3.0}/ascript/android/screen/gp.py +0 -0
  37. {ascript-1.2.8 → ascript-1.3.0}/ascript/android/screen/gp_tasks.py +0 -0
  38. {ascript-1.2.8 → ascript-1.3.0}/ascript/android/screen/gp_tool.py +0 -0
  39. {ascript-1.2.8 → ascript-1.3.0}/ascript/android/shizuku/__init__.py +0 -0
  40. {ascript-1.2.8 → ascript-1.3.0}/ascript/android/system/__init__.py +0 -0
  41. {ascript-1.2.8 → ascript-1.3.0}/ascript/android/ui.py +0 -0
  42. {ascript-1.2.8 → ascript-1.3.0}/ascript/hooks/__init__.py +0 -0
  43. {ascript-1.2.8 → ascript-1.3.0}/ascript/hooks/hook-ascript.py +0 -0
  44. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/__init__.py +0 -0
  45. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/action/__init__.py +0 -0
  46. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/developer/__init__.py +0 -0
  47. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/developer/api/__init__.py +0 -0
  48. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/developer/api/api_2_android.py +0 -0
  49. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/developer/api/api_code.py +0 -0
  50. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/developer/api/api_file.py +0 -0
  51. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/developer/api/api_label.py +0 -0
  52. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/developer/api/api_module.py +0 -0
  53. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/developer/api/api_node.py +0 -0
  54. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/developer/api/api_screen.py +0 -0
  55. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/developer/api/api_tool.py +0 -0
  56. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/developer/api/dao.py +0 -0
  57. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/developer/api/data.py +0 -0
  58. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/developer/api/file_utils.py +0 -0
  59. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/developer/api/label_utils.py +0 -0
  60. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/developer/api/line_helper.py +0 -0
  61. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/developer/api/oc.py +0 -0
  62. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/developer/api/oc_gp.py +0 -0
  63. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/developer/api/sp_utils.py +0 -0
  64. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/developer/api/utils.py +0 -0
  65. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/developer/api/wda_gp.py +0 -0
  66. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/developer/ws.py +0 -0
  67. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/ime.py +0 -0
  68. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/media.py +0 -0
  69. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/node.py +0 -0
  70. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/screen/__init__.py +0 -0
  71. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/screen/ascv.py +0 -0
  72. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/screen/color_tools.py +0 -0
  73. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/screen/dao.py +0 -0
  74. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/screen/gp.py +0 -0
  75. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/screen/yolov8.py +0 -0
  76. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/system/__init__.py +0 -0
  77. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/system/device.py +0 -0
  78. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/ui.py +0 -0
  79. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/wdapy/__init__.py +0 -0
  80. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/wdapy/_alert.py +0 -0
  81. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/wdapy/_base.py +0 -0
  82. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/wdapy/_node.py +0 -0
  83. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/wdapy/_proto.py +0 -0
  84. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/wdapy/_types.py +0 -0
  85. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/wdapy/_utils.py +0 -0
  86. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/wdapy/_wdapy.py +0 -0
  87. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/wdapy/_wrap.py +0 -0
  88. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/wdapy/exceptions.py +0 -0
  89. {ascript-1.2.8 → ascript-1.3.0}/ascript/ios/wdapy/xcui_element_types.py +0 -0
  90. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/__init__.py +0 -0
  91. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/daos/__init__.py +0 -0
  92. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/daos/screen.py +0 -0
  93. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/hardware/__init__.py +0 -0
  94. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/hardware/keyboard.py +0 -0
  95. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/license/__init__.py +0 -0
  96. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/license/achttp.cp310-win_amd64.pyd +0 -0
  97. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/license/achttp.cp311-win_amd64.pyd +0 -0
  98. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/license/achttp.cp312-win_amd64.pyd +0 -0
  99. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/license/achttp.cp313-win_amd64.pyd +0 -0
  100. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/license/achttp.cp314-win_amd64.pyd +0 -0
  101. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/license/achttp.cp38-win_amd64.pyd +0 -0
  102. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/license/achttp.cp39-win_amd64.pyd +0 -0
  103. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/media/__init__.py +0 -0
  104. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/resources/__init__.py +0 -0
  105. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/resources/templates/__init__.py +0 -0
  106. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/resources/templates/__init__py.win.template +0 -0
  107. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/resources/templates/build.as.win.template +0 -0
  108. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/resources/templates/build.py +0 -0
  109. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/resources/templates/logo_windows.ico +0 -0
  110. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/resources/templates/windows/main.py +0 -0
  111. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/resources/templates/windows/pyproject.toml +0 -0
  112. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/resources/templates/windows/res/img/logo.ico +0 -0
  113. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/screen/as_cv.py +0 -0
  114. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/screen/find_colors.py +0 -0
  115. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/screen/find_images.py +0 -0
  116. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/screen/ocr/__init__.py +0 -0
  117. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/store/__init__.py +0 -0
  118. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/system/__init__.py +0 -0
  119. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/system/device.py +0 -0
  120. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/system/easy_print.py +0 -0
  121. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/system/env.py +0 -0
  122. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/system/exception/__init__.py +0 -0
  123. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/system/key_value.py +0 -0
  124. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/system/pip.py +0 -0
  125. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/system/runtime.py +0 -0
  126. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__init__.py +0 -0
  127. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/__init__.cpython-310.pyc +0 -0
  128. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/__init__.cpython-312.pyc +0 -0
  129. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/__init__.cpython-313.pyc +0 -0
  130. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/__init__.cpython-39.pyc +0 -0
  131. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/action.cpython-310.pyc +0 -0
  132. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/action.cpython-312.pyc +0 -0
  133. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/action.cpython-313.pyc +0 -0
  134. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/action.cpython-39.pyc +0 -0
  135. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/colors_tool.cpython-310.pyc +0 -0
  136. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/colors_tool.cpython-313.pyc +0 -0
  137. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/colors_tool.cpython-39.pyc +0 -0
  138. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/config.cpython-310.pyc +0 -0
  139. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/config.cpython-312.pyc +0 -0
  140. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/config.cpython-313.pyc +0 -0
  141. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/config.cpython-39.pyc +0 -0
  142. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/dumptool.cpython-310.pyc +0 -0
  143. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/dumptool.cpython-313.pyc +0 -0
  144. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/dumptool.cpython-39.pyc +0 -0
  145. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/eel_api.cpython-310.pyc +0 -0
  146. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/eel_api.cpython-312.pyc +0 -0
  147. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/eel_api.cpython-313.pyc +0 -0
  148. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/eel_api.cpython-39.pyc +0 -0
  149. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/mouse_catch.cpython-310.pyc +0 -0
  150. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/mouse_catch.cpython-312.pyc +0 -0
  151. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/mouse_catch.cpython-313.pyc +0 -0
  152. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/mouse_catch.cpython-39.pyc +0 -0
  153. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/plug_manager.cpython-310.pyc +0 -0
  154. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/plug_manager.cpython-312.pyc +0 -0
  155. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/plug_manager.cpython-313.pyc +0 -0
  156. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/__pycache__/plug_manager.cpython-39.pyc +0 -0
  157. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/action.json +0 -0
  158. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/action.py +0 -0
  159. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/config.py +0 -0
  160. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/eel_api.py +0 -0
  161. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/gpplug/__init__.py +0 -0
  162. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/gpplug/__pycache__/__init__.cpython-310.pyc +0 -0
  163. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/gpplug/__pycache__/__init__.cpython-312.pyc +0 -0
  164. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/gpplug/__pycache__/__init__.cpython-313.pyc +0 -0
  165. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/gpplug/__pycache__/__init__.cpython-39.pyc +0 -0
  166. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/gpplug/__pycache__/plug.cpython-310.pyc +0 -0
  167. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/gpplug/__pycache__/plug.cpython-312.pyc +0 -0
  168. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/gpplug/__pycache__/plug.cpython-313.pyc +0 -0
  169. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/gpplug/__pycache__/plug.cpython-39.pyc +0 -0
  170. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/gpplug/plug.py +0 -0
  171. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/mouse_catch.py +0 -0
  172. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/plug_manager.py +0 -0
  173. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/app_store_window.html +0 -0
  174. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/colors.html +0 -0
  175. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/css/screen.css +0 -0
  176. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/css/viewtree.css +0 -0
  177. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/flot_control.html +0 -0
  178. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/img/ico/favicon.png +0 -0
  179. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/img/ico/paintpalette.png +0 -0
  180. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/img/svg/find_colors.svg +0 -0
  181. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/img/svg/find_images.svg +0 -0
  182. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/img/svg/illustration-6.svg +0 -0
  183. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/img/svg/img_default.svg +0 -0
  184. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/img/svg/ocr.svg +0 -0
  185. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/js/screen/colors.js +0 -0
  186. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/js/screen/gp_plug.js +0 -0
  187. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/js/screen/image_mouse.js +0 -0
  188. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/js/screen/img_view.js +0 -0
  189. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/js/screen/plug.js +0 -0
  190. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/js/screen/screen.js +0 -0
  191. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/js/screen/screen_api.js +0 -0
  192. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/js/screen/screen_maker.js +0 -0
  193. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/js/utils/map.js +0 -0
  194. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/js/utils/upload.js +0 -0
  195. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/js/viewtree/niv_js.js +0 -0
  196. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/js/viewtree/vtree.js +0 -0
  197. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/bootstrap/css/bootstrap.min.css +0 -0
  198. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/bootstrap/js/bootstrap.bundle.min.js +0 -0
  199. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/bootstrap-icons/0-circle.svg +0 -0
  200. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/bootstrap-icons/0-square.svg +0 -0
  201. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/bootstrap-icons/font/bootstrap-icons.css +0 -0
  202. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/bootstrap-icons/font/bootstrap-icons.json +0 -0
  203. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/bootstrap-icons/font/bootstrap-icons.min.css +0 -0
  204. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/bootstrap-icons/font/bootstrap-icons.scss +0 -0
  205. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/bootstrap-icons/font/fonts/bootstrap-icons.woff +0 -0
  206. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/bootstrap-icons/font/fonts/bootstrap-icons.woff2 +0 -0
  207. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/feather-icons/dist/feather.min.js +0 -0
  208. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/feather-icons/dist/icons.json +0 -0
  209. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/jquery/core.js +0 -0
  210. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/jquery/jquery.js +0 -0
  211. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/jquery/jquery.min.js +0 -0
  212. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/jquery/jquery.min.js.zip +0 -0
  213. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/jquery/jquery.slim.js +0 -0
  214. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/jquery/jquery.slim.min.js +0 -0
  215. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/jquery-menu/jquery.contextMenu.js +0 -0
  216. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/jquery-menu/jquery.contextMenu.min.css +0 -0
  217. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/jquery-zTree/css/zTreeStyle.css +0 -0
  218. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/jquery-zTree/img/diy/1_close.png +0 -0
  219. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/jquery-zTree/img/diy/1_open.png +0 -0
  220. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/jquery-zTree/img/diy/2.png +0 -0
  221. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/jquery-zTree/img/diy/3.png +0 -0
  222. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/jquery-zTree/img/diy/4.png +0 -0
  223. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/jquery-zTree/img/diy/5.png +0 -0
  224. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/jquery-zTree/img/diy/6.png +0 -0
  225. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/jquery-zTree/img/diy/7.png +0 -0
  226. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/jquery-zTree/img/diy/8.png +0 -0
  227. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/jquery-zTree/img/diy/9.png +0 -0
  228. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/jquery-zTree/img/line_conn.gif +0 -0
  229. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/jquery-zTree/img/loading.gif +0 -0
  230. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/jquery-zTree/img/tree-node-btn.png +0 -0
  231. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/jquery-zTree/img/zTreeStandard.gif +0 -0
  232. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/jquery-zTree/img/zTreeStandard.png +0 -0
  233. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/jquery-zTree/js/jquery.ztree.all.min.js +0 -0
  234. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/treeview/css/jquery.treeview.css +0 -0
  235. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/treeview/img/file.png +0 -0
  236. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/treeview/img/ico_loading.png +0 -0
  237. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/treeview/img/icon4.png +0 -0
  238. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/treeview/img/icon5.png +0 -0
  239. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/treeview/img/icon6.png +0 -0
  240. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/treeview/img/py.png +0 -0
  241. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/treeview/img/treeview-black-line.gif +0 -0
  242. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/treeview/img/treeview-black.gif +0 -0
  243. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/treeview/img/treeview-default-line.gif +0 -0
  244. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/treeview/img/treeview-default.gif +0 -0
  245. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/treeview/img/treeview-famfamfam-line.gif +0 -0
  246. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/treeview/img/treeview-famfamfam.gif +0 -0
  247. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/treeview/img/treeview-gray-line.gif +0 -0
  248. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/treeview/img/treeview-gray.gif +0 -0
  249. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/treeview/img/treeview-red-line.gif +0 -0
  250. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/treeview/img/treeview-red.gif +0 -0
  251. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/treeview/js/jquery.treeview.edit.js +0 -0
  252. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/libs/treeview/js/jquery.treeview.js +0 -0
  253. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/license_window.html +0 -0
  254. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/plugs/a.html +0 -0
  255. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/plugs/demo.html +0 -0
  256. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/plugs/find_colors.html +0 -0
  257. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/plugs/find_images.html +0 -0
  258. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/plugs/rapidocr.html +0 -0
  259. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/tools/web/vtree.html +0 -0
  260. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/ui/__init__.py +0 -0
  261. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/ui/app_store_window.py +0 -0
  262. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/ui/draw_window.py +0 -0
  263. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/ui/flot_test.py +0 -0
  264. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/ui/flot_window.py +0 -0
  265. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/ui/license_window.py +0 -0
  266. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/utils/__init__.py +0 -0
  267. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/utils/node_utils.py +0 -0
  268. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/utils/screen_utils.py +0 -0
  269. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/window/Selector.py +0 -0
  270. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/window/__init__.py +0 -0
  271. {ascript-1.2.8 → ascript-1.3.0}/ascript/windows/window/launcher.py +0 -0
  272. {ascript-1.2.8 → ascript-1.3.0}/ascript.egg-info/dependency_links.txt +0 -0
  273. {ascript-1.2.8 → ascript-1.3.0}/ascript.egg-info/top_level.txt +0 -0
  274. {ascript-1.2.8 → ascript-1.3.0}/docs/source/_build/_sources/autoapi/ascript/windows/client/tools/index.rst.txt +0 -0
  275. {ascript-1.2.8 → ascript-1.3.0}/docs/source/_build/autoapi/ascript/windows/client/tools/index.html +0 -0
  276. {ascript-1.2.8 → ascript-1.3.0}/docs/source/build_index.py +0 -0
  277. {ascript-1.2.8 → ascript-1.3.0}/docs/source/conf.py +0 -0
  278. {ascript-1.2.8 → ascript-1.3.0}/docs/source/doc_extractor.py +0 -0
  279. {ascript-1.2.8 → ascript-1.3.0}/docs/source/generate_api_data.py +0 -0
  280. {ascript-1.2.8 → ascript-1.3.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ascript
3
- Version: 1.2.8
3
+ Version: 1.3.0
4
4
  Summary: Ascript Developer Library
5
5
  License: MIT
6
6
  Classifier: Operating System :: Microsoft :: Windows
@@ -27,6 +27,7 @@ Requires-Dist: uiautomation>=2.0.20
27
27
  Requires-Dist: pywin32>=306
28
28
  Requires-Dist: psutil>=5.9.0
29
29
  Requires-Dist: pyautogui>=0.9.54
30
+ Requires-Dist: pydirectinput>=0.1.1
30
31
  Requires-Dist: opencv-python>=4.9.0.0
31
32
  Requires-Dist: pillow>=10.0.0
32
33
  Requires-Dist: numpy>=1.26.0
@@ -0,0 +1,126 @@
1
+ import ctypes
2
+ import time
3
+ import sys
4
+ import os
5
+ from ..system import R
6
+
7
+
8
+ class LogitechDriver:
9
+ DLL_NAME = "LogitechGkeyEnginesWrapper.dll"
10
+
11
+ _dll = None
12
+ _initialized = False
13
+
14
+ @classmethod
15
+ def _get_dll_path(cls):
16
+ """根据 Python 位数精准定位 DLL 路径"""
17
+ arch = "x64" if sys.maxsize > 2 ** 32 else "x86"
18
+ return R.internal("windows", "resources", "libs", "logitech", arch, cls.DLL_NAME)
19
+
20
+ @classmethod
21
+ def _is_ghub_running(cls) -> bool:
22
+ """多重检测 G HUB 是否在运行"""
23
+ try:
24
+ # 罗技 G HUB 可能存在于这三个进程中
25
+ targets = {"lghub.exe", "lghub_agent.exe", "lghub_updater.exe"}
26
+ with os.popen('tasklist /NH /FI "STATUS eq running"') as f:
27
+ output = f.read().lower()
28
+ return any(t in output for t in targets)
29
+ except:
30
+ return False
31
+
32
+ @classmethod
33
+ def init(cls) -> bool:
34
+ """
35
+ 深度初始化逻辑
36
+ """
37
+ if cls._initialized:
38
+ return True
39
+
40
+ # 1. 环境检查
41
+ if not cls._is_ghub_running():
42
+ print("[LogitechDriver] 错误: 未检测到 G HUB 进程,请确保罗技驱动已启动。")
43
+ return False
44
+
45
+ dll_path = cls._get_dll_path()
46
+ if not os.path.exists(dll_path):
47
+ print(f"[LogitechDriver] 错误: 找不到 DLL -> {dll_path}")
48
+ return False
49
+
50
+ try:
51
+ # 2. 加载 DLL 并强制使用 Windows 路径标准
52
+ cls._dll = ctypes.CDLL(dll_path)
53
+
54
+ # 3. 尝试所有可能的初始化导出函数
55
+ # 罗技 SDK 随版本变化,函数名可能为以下其一
56
+ init_functions = [
57
+ "LogiGkeyInitWithoutContext",
58
+ "LogiGkeyInit",
59
+ "LogiGkeyInitWithoutScene"
60
+ ]
61
+
62
+ success = False
63
+ for func_name in init_functions:
64
+ if hasattr(cls._dll, func_name):
65
+ if getattr(cls._dll, func_name)():
66
+ success = True
67
+ break
68
+
69
+ if success:
70
+ # [关键] 驱动初始化后必须等待,否则紧随其后的指令会丢失
71
+ time.sleep(0.5)
72
+ cls._initialized = True
73
+ return True
74
+
75
+ return False
76
+ except Exception as e:
77
+ print(f"[LogitechDriver] 加载异常: {e}")
78
+ return False
79
+
80
+ @classmethod
81
+ def advanced_click_guide(cls):
82
+ """高级引导:检查权限与环境"""
83
+ print("--- [Logitech] 底层引擎自检 ---")
84
+
85
+ # 管理员权限检查
86
+ try:
87
+ is_admin = ctypes.windll.shell32.IsUserAnAdmin() != 0
88
+ except:
89
+ is_admin = False
90
+
91
+ if not is_admin:
92
+ print("⚠️ 注意: 当前非管理员权限,这可能是点击无效的主因!")
93
+
94
+ if cls.init():
95
+ print("✅ 驱动模式已激活。")
96
+ return True
97
+ else:
98
+ print("❌ 驱动激活失败,请检查 G HUB 是否正常运行。")
99
+ return False
100
+
101
+ @classmethod
102
+ def click(cls, button: int = 1, duration: float = 0.05):
103
+ """
104
+ 驱动级点击
105
+ :param button: 1=左键, 2=中键, 4=右键 (注意:SDK 中右键通常是 4)
106
+ """
107
+ if not cls.init():
108
+ return False
109
+ try:
110
+ cls._dll.LogiMouseButtonPressed(button)
111
+ time.sleep(duration)
112
+ cls._dll.LogiMouseButtonReleased(button)
113
+ return True
114
+ except:
115
+ return False
116
+
117
+ @classmethod
118
+ def move_rel(cls, x: int, y: int):
119
+ """相对移动"""
120
+ if not cls.init():
121
+ return False
122
+ try:
123
+ # 罗技相对移动
124
+ return cls._dll.LogiMouseRelativeMove(int(x), int(y))
125
+ except:
126
+ return False
@@ -0,0 +1,112 @@
1
+ import time
2
+ import random
3
+ import pydirectinput
4
+ from ctypes import windll
5
+ from typing import Optional
6
+
7
+ # 启用 DPI 感知
8
+ try:
9
+ windll.shcore.SetProcessDpiAwareness(1)
10
+ except:
11
+ try:
12
+ windll.user32.SetProcessDPIAware()
13
+ except:
14
+ pass
15
+
16
+
17
+ class Mouse:
18
+ """
19
+ 基于 PyDirectInput 优化的鼠标控制类。
20
+ """
21
+
22
+ # 基础按键定义
23
+ LEFT = "left"
24
+ MIDDLE = "middle"
25
+ RIGHT = "right"
26
+
27
+ # 全局配置
28
+ pydirectinput.FAILSAFE = True
29
+ DEFAULT_MOVE_DURATION = 0.1
30
+
31
+ @classmethod
32
+ def mouse_move(cls, x: int, y: int, move_duration: float = DEFAULT_MOVE_DURATION):
33
+ """移动鼠标到指定位置"""
34
+ pydirectinput.moveTo(x=x, y=y, duration=move_duration)
35
+ return cls
36
+
37
+ @classmethod
38
+ def mouse_down(cls, x: int = None, y: int = None, button: str = LEFT):
39
+ """按下鼠标按键"""
40
+ pydirectinput.mouseDown(x=x, y=y, button=button)
41
+ return cls
42
+
43
+ @classmethod
44
+ def mouse_up(cls, x: int = None, y: int = None, button: str = LEFT):
45
+ """松开鼠标按键"""
46
+ pydirectinput.mouseUp(x=x, y=y, button=button)
47
+ return cls
48
+
49
+ @classmethod
50
+ def click(cls,
51
+ x: Optional[int] = None,
52
+ y: Optional[int] = None,
53
+ clicks: int = 1,
54
+ interval: float = 0.1,
55
+ button: str = LEFT,
56
+ move_duration: float = 0.0,
57
+ duration: float = 0.05,
58
+ offset: int = 0):
59
+ """
60
+ 模拟鼠标点击。
61
+ :param duration: 按下与弹起之间的物理间隔,增加此值可提高模拟点击的成功率。
62
+ """
63
+ target_x, target_y = x, y
64
+
65
+ if offset > 0 and x is not None and y is not None:
66
+ target_x = max(0, x + random.randint(-offset, offset))
67
+ target_y = max(0, y + random.randint(-offset, offset))
68
+
69
+ if target_x is not None and target_y is not None:
70
+ cls.mouse_move(target_x, target_y, move_duration=move_duration)
71
+
72
+ for i in range(clicks):
73
+ cls.mouse_down(button=button)
74
+ time.sleep(max(0.01, duration))
75
+ cls.mouse_up(button=button)
76
+ if i < clicks - 1:
77
+ time.sleep(interval)
78
+ return cls
79
+
80
+ @classmethod
81
+ def long_press(cls, x: int = None, y: int = None, press_duration: float = 2.0, button: str = LEFT):
82
+ """模拟长按逻辑"""
83
+ if x is not None and y is not None:
84
+ cls.mouse_move(x, y, move_duration=0.0)
85
+
86
+ cls.mouse_down(button=button)
87
+ time.sleep(press_duration)
88
+ cls.mouse_up(button=button)
89
+ return cls
90
+
91
+ @classmethod
92
+ def scroll(cls, clicks: int, x: int = None, y: int = None):
93
+ """模拟滚动"""
94
+ if x is not None and y is not None:
95
+ cls.mouse_move(x, y, move_duration=0.0)
96
+ pydirectinput.scroll(clicks)
97
+ return cls
98
+
99
+ @classmethod
100
+ def drag(cls, to_x: int, to_y: int, from_x: int = None, from_y: int = None, move_duration: float = 0.5):
101
+ """从指定位置拖拽到目标位置"""
102
+ if from_x is not None and from_y is not None:
103
+ cls.mouse_move(from_x, from_y, move_duration=0.0)
104
+
105
+ pydirectinput.dragTo(to_x, to_y, duration=move_duration, button=cls.LEFT)
106
+ return cls
107
+
108
+ @classmethod
109
+ def wait(cls, seconds: float):
110
+ """链式调用中的逻辑等待"""
111
+ time.sleep(seconds)
112
+ return cls
@@ -1,4 +1,3 @@
1
-
2
1
  from .screen_core import Screen
3
2
  from .find_images import FindImages
4
3
  from .find_colors import FindColors
@@ -160,7 +160,7 @@ class RapidOCRHook(importlib.abc.MetaPathFinder):
160
160
  if not hasattr(cls, "find"):
161
161
  cls.find = find
162
162
  cls.find_all = find_all
163
- print(f"✅ [RapidOCR-Hook] 成功注入 find/find_all 扩展")
163
+ # print(f"✅ [RapidOCR-Hook] 成功注入 find/find_all 扩展")
164
164
 
165
165
 
166
166
  def install():
@@ -80,7 +80,6 @@ class Screen:
80
80
  if format.startswith("base64"):
81
81
  # 默认 jpeg,除非明确指定 base64:png
82
82
  sub_format = "PNG" if (":" in format and format.split(":")[1].lower() == "png") else "JPEG"
83
-
84
83
  buffered = BytesIO()
85
84
  img.save(buffered, format=sub_format, quality=80 if sub_format == "JPEG" else None)
86
85
  img_str = base64.b64encode(buffered.getvalue()).decode("utf-8")
@@ -2,6 +2,8 @@ import sys
2
2
  import os
3
3
  from pathlib import Path
4
4
  import ascript # 必须导入你的包以定位其物理位置
5
+ import sys
6
+ import ctypes
5
7
 
6
8
  class R:
7
9
  _BASE_DIR = None
@@ -76,4 +78,21 @@ class R:
76
78
  return str(bundle_path)
77
79
 
78
80
  # B. 开发环境或兜底 (寻找 site-packages/ascript/xxx)
79
- return cls._build_path(cls._PKG_ROOT, *sub_paths)
81
+ return cls._build_path(cls._PKG_ROOT, *sub_paths)
82
+
83
+ @classmethod
84
+ def is_admin(cls):
85
+ try:
86
+ return ctypes.windll.shell32.IsUserAnAdmin()
87
+ except:
88
+ return False
89
+
90
+ @classmethod
91
+ def run_as_admin(cls):
92
+ """如果不是管理员,自动重启并请求管理员权限"""
93
+ if not cls.is_admin():
94
+ # ShellExecuteEx 会触发系统 UAC 弹窗
95
+ ctypes.windll.shell32.ShellExecuteW(
96
+ None, "runas", sys.executable, " ".join(sys.argv), None, 1
97
+ )
98
+ sys.exit()
@@ -241,8 +241,7 @@ def start_colors(hwnd:str = None,window_title:str = None):
241
241
  # 获取一个临时的绝对路径作为用户数据目录
242
242
  data_dir = os.path.join(os.getcwd(), 'chrome_debug_profile')
243
243
 
244
- eel_kwargs = {
245
- 'mode': 'chrome',
244
+ eel_kwargs_base = {
246
245
  'port': 0,
247
246
  'cmdline_args': [
248
247
  '--start-maximized',
@@ -255,16 +254,20 @@ def start_colors(hwnd:str = None,window_title:str = None):
255
254
  }
256
255
 
257
256
  print("正在启动 图形处理 工具...")
258
- try:
259
- # 这一行搞定:如果有 hwnd 则拼接参数,否则为空字符串
260
- url = f"colors.html?hwnd={hwnd}" if hwnd else "colors.html"
261
- # 启动线程
262
- threading.Thread(target=listen_win32_hotkey, daemon=True).start()
263
- eel.start(url, **eel_kwargs)
264
-
265
- # eel.start('index.html', mode='chrome', cmdline_args=['--disable-web-security', '--user-data-dir=remote-debug'])
257
+ url = f"colors.html?hwnd={hwnd}" if hwnd else "colors.html"
258
+ threading.Thread(target=listen_win32_hotkey, daemon=True).start()
266
259
 
260
+ try:
261
+ for mode in ('chrome', 'edge', 'edgechromium'):
262
+ try:
263
+ eel.start(url, mode=mode, **eel_kwargs_base)
264
+ break
265
+ except OSError as e:
266
+ if 'find' in str(e).lower() and 'installation' in str(e).lower():
267
+ continue
268
+ raise
269
+ else:
270
+ print("错误:未检测到可用浏览器。请安装 Chrome 或 Edge 浏览器。")
267
271
  except (SystemExit, MemoryError, KeyboardInterrupt):
268
- # 正常退出
269
272
  pass
270
273
 
@@ -23,14 +23,23 @@ def start_vtree(hwnd: str = None, window_title: str = None):
23
23
 
24
24
  eel.init(web_folder)
25
25
 
26
- eel_kwargs = {
27
- 'mode': 'chrome',
26
+ eel_kwargs_base = {
28
27
  'port': 0,
29
28
  'cmdline_args': ['--start-maximized', '--incognito']
30
29
  }
31
30
 
31
+ url = f"vtree.html?hwnd={hwnd}" if hwnd else "vtree.html"
32
+
32
33
  try:
33
- url = f"vtree.html?hwnd={hwnd}" if hwnd else "vtree.html"
34
- eel.start(url, **eel_kwargs)
34
+ for mode in ('chrome', 'edge', 'edgechromium'):
35
+ try:
36
+ eel.start(url, mode=mode, **eel_kwargs_base)
37
+ break
38
+ except OSError as e:
39
+ if 'find' in str(e).lower() and 'installation' in str(e).lower():
40
+ continue
41
+ raise
42
+ else:
43
+ print("错误:未检测到可用浏览器。请安装 Chrome 或 Edge 浏览器。")
35
44
  except (SystemExit, MemoryError, KeyboardInterrupt):
36
45
  pass
@@ -1,4 +1,4 @@
1
- import time
1
+ import threading
2
2
 
3
3
  import webview
4
4
  import os
@@ -17,7 +17,7 @@ class WebWindow:
17
17
  self._exposed_functions[func.__name__] = func
18
18
  return func
19
19
 
20
- def show(self, title: str = "AScript Window", debug=False, **kwargs):
20
+ def show(self, title: str = "AScript Window", debug=False, block: bool = True, **kwargs):
21
21
  class ApiBridge:
22
22
  def __init__(self, funcs): self._funcs = funcs
23
23
  def call_internal(self, func_name, args):
@@ -53,9 +53,15 @@ class WebWindow:
53
53
  # print("end", time.time())
54
54
 
55
55
  # 启动并绑定加载完成事件
56
- webview.start(on_loaded, debug=debug)
57
- # 窗口关闭后,返回存储的结果
58
- return self._return_value
56
+ if block:
57
+ webview.start(on_loaded, debug=debug)
58
+ return self._return_value
59
+ else:
60
+ def _run():
61
+ webview.start(on_loaded, debug=debug)
62
+
63
+ t = threading.Thread(target=_run, daemon=True)
64
+ t.start()
59
65
 
60
66
  def close(self):
61
67
  if self.webview_instance:
@@ -23,7 +23,6 @@ try:
23
23
  except:
24
24
  windll.user32.SetProcessDPIAware()
25
25
 
26
-
27
26
  # 1. 定义独立的结构类
28
27
  class WindowRect(NamedTuple):
29
28
  """窗口空间位置信息 (不占内存,支持补全)"""
@@ -220,8 +219,26 @@ class Window:
220
219
  # --- 状态属性 ---
221
220
  @property
222
221
  def is_visible(self):
223
- """窗口是否可见"""
224
- return win32gui.IsWindowVisible(self.hwnd)
222
+ # 1. 基础检查:系统必须认为它是可见的
223
+ if not win32gui.IsWindowVisible(self.hwnd):
224
+ return False
225
+
226
+ # 2. 面积检查:宽高必须大于 0
227
+ left, top, right, bottom = win32gui.GetWindowRect(self.hwnd)
228
+ width = right - left
229
+ height = bottom - top
230
+ if width <= 0 or height <= 0:
231
+ return False
232
+
233
+ # 3. 坐标检查:不能在极远的“异次元”坐标(有些库会把隐藏窗口丢到 -32000)
234
+ if left < -30000 or top < -30000:
235
+ return False
236
+
237
+ # 4. 标题检查(可选):如果标题变空了,可能窗口正在销毁中
238
+ if not win32gui.GetWindowText(self.hwnd):
239
+ return False
240
+
241
+ return True
225
242
 
226
243
  @property
227
244
  def is_minimized(self):
@@ -231,12 +248,36 @@ class Window:
231
248
  @property
232
249
  def is_maximized(self):
233
250
  """是否最大化"""
234
- return win32gui.IsZoomed(self.hwnd) != 0
251
+ tup = win32gui.GetWindowPlacement(self.hwnd)
252
+ return tup[1] == win32con.SW_SHOWMAXIMIZED
235
253
 
236
254
  @property
237
255
  def is_responding(self):
238
256
  """窗口是否响应(未卡死)"""
239
- return windll.user32.IsHungAppWindow(self.hwnd) == 0
257
+ # 显式获取函数对象,避免属性查找错误
258
+ is_hung = getattr(windll.user32, "IsHungAppWindow", None)
259
+ if is_hung:
260
+ return is_hung(self.hwnd) == 0
261
+
262
+ # 如果还是找不到,回退到方案二
263
+ return self._check_responding_via_timeout()
264
+
265
+ @property
266
+ def _check_responding_via_timeout(self):
267
+ try:
268
+ # SMTO_ABORTIFHUNG: 如果窗口已卡死,直接返回
269
+ # 100 是超时时间(毫秒)
270
+ res = win32gui.SendMessageTimeout(
271
+ self.hwnd,
272
+ win32con.WM_NULL,
273
+ 0, 0,
274
+ win32con.SMTO_ABORTIFHUNG | win32con.SMTO_BLOCK,
275
+ 100
276
+ )
277
+ # 如果返回值为 0,通常表示超时或失败
278
+ return res[0] != 0
279
+ except:
280
+ return False
240
281
 
241
282
  @property
242
283
  def is_always_on_top(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ascript
3
- Version: 1.2.8
3
+ Version: 1.3.0
4
4
  Summary: Ascript Developer Library
5
5
  License: MIT
6
6
  Classifier: Operating System :: Microsoft :: Windows
@@ -27,6 +27,7 @@ Requires-Dist: uiautomation>=2.0.20
27
27
  Requires-Dist: pywin32>=306
28
28
  Requires-Dist: psutil>=5.9.0
29
29
  Requires-Dist: pyautogui>=0.9.54
30
+ Requires-Dist: pydirectinput>=0.1.1
30
31
  Requires-Dist: opencv-python>=4.9.0.0
31
32
  Requires-Dist: pillow>=10.0.0
32
33
  Requires-Dist: numpy>=1.26.0
@@ -77,6 +77,7 @@ ascript/windows/daos/__init__.py
77
77
  ascript/windows/daos/screen.py
78
78
  ascript/windows/hardware/__init__.py
79
79
  ascript/windows/hardware/keyboard.py
80
+ ascript/windows/hardware/logitech_driver.py
80
81
  ascript/windows/hardware/mouse.py
81
82
  ascript/windows/license/__init__.py
82
83
  ascript/windows/license/achttp.cp310-win_amd64.pyd
@@ -88,6 +89,8 @@ ascript/windows/license/achttp.cp38-win_amd64.pyd
88
89
  ascript/windows/license/achttp.cp39-win_amd64.pyd
89
90
  ascript/windows/media/__init__.py
90
91
  ascript/windows/resources/__init__.py
92
+ ascript/windows/resources/libs/logitech/x64/LogitechGkeyEnginesWrapper.dll
93
+ ascript/windows/resources/libs/logitech/x86/LogitechGkeyEnginesWrapper.dll
91
94
  ascript/windows/resources/templates/__init__.py
92
95
  ascript/windows/resources/templates/__init__py.win.template
93
96
  ascript/windows/resources/templates/build.as.win.template
@@ -9,6 +9,7 @@ uiautomation>=2.0.20
9
9
  pywin32>=306
10
10
  psutil>=5.9.0
11
11
  pyautogui>=0.9.54
12
+ pydirectinput>=0.1.1
12
13
  opencv-python>=4.9.0.0
13
14
  pillow>=10.0.0
14
15
  numpy>=1.26.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ascript"
7
- version = "1.2.8"
7
+ version = "1.3.0"
8
8
  description = "Ascript Developer Library"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -44,6 +44,7 @@ dependencies = [
44
44
  "pywin32>=306",
45
45
  "psutil>=5.9.0",
46
46
  "pyautogui>=0.9.54",
47
+ "pydirectinput >= 0.1.1",
47
48
  "opencv-python>=4.9.0.0",
48
49
  "pillow>=10.0.0",
49
50
  "numpy>=1.26.0",