commit
df05dbe6bd
@ -0,0 +1,21 @@ |
||||
MouseInfo==0.1.3 |
||||
numpy==2.2.6 |
||||
opencv-python==4.12.0.88 |
||||
pillow==11.3.0 |
||||
PyAutoGUI==0.9.54 |
||||
PyGetWindow==0.0.9 |
||||
PyMsgBox==2.0.1 |
||||
pynput==1.8.1 |
||||
pyobjc-core==11.1 |
||||
pyobjc-framework-ApplicationServices==11.1 |
||||
pyobjc-framework-Cocoa==11.1 |
||||
pyobjc-framework-CoreText==11.1 |
||||
pyobjc-framework-Quartz==11.1 |
||||
pyperclip==1.11.0 |
||||
PyRect==0.2.0 |
||||
PyScreeze==1.0.1 |
||||
pytweening==1.2.0 |
||||
rubicon-objc==0.5.2 |
||||
setuptools==78.1.1 |
||||
six==1.17.0 |
||||
wheel==0.45.1 |
||||
|
After Width: | Height: | Size: 4.2 KiB |
@ -0,0 +1,49 @@ |
||||
import subprocess |
||||
import time |
||||
import os |
||||
|
||||
def test_mouse_movement_cliclick(): |
||||
print("🐭 鼠标移动测试程序 (cliclick 版本)") |
||||
print("=" * 40) |
||||
|
||||
# 检查 cliclick 是否安装 |
||||
try: |
||||
result = subprocess.run(['which', 'cliclick'], capture_output=True, text=True) |
||||
if result.returncode != 0: |
||||
print("❌ cliclick 未安装") |
||||
print("请先安装: brew install cliclick") |
||||
return |
||||
except: |
||||
print("❌ 无法检查 cliclick 安装状态") |
||||
return |
||||
|
||||
# 获取屏幕尺寸 |
||||
try: |
||||
screen_width, screen_height = 2560, 1440 # 常见 Mac 分辨率,您可能需要调整 |
||||
center_x = screen_width // 2 |
||||
center_y = screen_height // 2 |
||||
|
||||
print(f"假设屏幕尺寸: {screen_width} x {screen_height}") |
||||
print(f"中心点坐标: ({center_x}, {center_y})") |
||||
|
||||
print("3秒后移动鼠标到屏幕中心...") |
||||
for i in range(3, 0, -1): |
||||
print(f"{i}...") |
||||
time.sleep(1) |
||||
|
||||
# 使用 cliclick 移动鼠标 |
||||
command = f"cliclick m:{center_x},{center_y}" |
||||
print(f"执行命令: {command}") |
||||
|
||||
result = subprocess.run(command, shell=True, capture_output=True, text=True) |
||||
|
||||
if result.returncode == 0: |
||||
print("✅ cliclick 移动成功!") |
||||
else: |
||||
print(f"❌ cliclick 移动失败: {result.stderr}") |
||||
|
||||
except Exception as e: |
||||
print(f"❌ 出错: {e}") |
||||
|
||||
if __name__ == "__main__": |
||||
test_mouse_movement_cliclick() |
||||
Loading…
Reference in new issue