名称: hidpi-mouse
描述: 适用于 Linux 桌面自动化的通用 HiDPI 鼠标点击处理。自动检测缩放因子或允许针对任何屏幕分辨率/DPI 进行校准。将 Claude 显示坐标转换为 xdotool 屏幕坐标。
元数据: {"os": ["linux"], "requires": {"bins": ["xdotool", "scrot", "python3"]}}
user-invocable: false
适用于不同屏幕配置的桌面自动化通用鼠标坐标处理。
# 在 Claude 显示坐标处点击(自动缩放)
./scripts/click.sh 500 300
# 首次使用?运行校准以获得最佳精度
./scripts/calibrate.sh
当 Claude 显示截图时,会将其缩小。本技能负责坐标转换:
Claude 显示坐标 → 缩放因子 → xdotool 屏幕坐标
缩放因子取决于:
- 屏幕分辨率(1080p、1440p、4K 等)
- DPI 设置(96、144、192 等)
- Claude 的显示视口
./scripts/click.sh <x> <y> # 自动缩放点击
./scripts/click.sh --raw <x> <y> # 无缩放(屏幕坐标)
./scripts/click.sh --double <x> <y> # 双击
./scripts/click.sh --right <x> <y> # 右键点击
./scripts/calibrate.sh # 交互式校准
./scripts/calibrate.sh info # 显示当前配置
./scripts/calibrate.sh test # 测试当前缩放
./scripts/calibrate.sh set 2.08 # 手动设置缩放因子
./scripts/calibrate.sh reset # 重置为自动检测
./scripts/detect-scale.sh # 返回缩放因子(例如 2.08)
./scripts/move.sh <x> <y> # 移动鼠标
./scripts/drag.sh <x1> <y1> <x2> <y2> # 拖拽
./scripts/reliable_click.sh <x> <y> [--window "窗口名" --relative]
为在您的特定系统上获得最佳精度:
./scripts/calibrate.sh
此操作将:
1. 创建一个带有已知位置标记的校准图像
2. 询问您标记在 Claude 显示中的位置
3. 计算并保存精确的缩放因子
| 屏幕 | DPI | 典型缩放因子 |
|---|---|---|
| 1920×1080 | 96 | 1.0 - 1.2 |
| 2560×1440 | 96 | 1.3 - 1.5 |
| 3024×1772 | 192 | 2.08 |
| 3840×2160 | 192 | 2.0 - 2.5 |
# 运行校准
./scripts/calibrate.sh
# 或手动调整
./scripts/calibrate.sh set 2.1 # 尝试不同的值
./scripts/calibrate.sh info
./scripts/calibrate.sh reset
rm -f /tmp/hidpi_scale_cache
~/.config/hidpi-mouse/scale.conf - 用户设置的缩放因子(最高优先级)/tmp/hidpi_scale_cache - 自动检测的缩放因子缓存(1 小时 TTL)本技能自动适配:
- ✅ 不同的屏幕分辨率(1080p 至 4K+)
- ✅ 不同的 DPI 设置(96、120、144、192 等)
- ✅ HiDPI/Retina 显示屏
- ✅ 多显示器设置(主显示器)
--raw 参数 如果您已拥有屏幕坐标calibrate.sh info 查看当前设置# 1. 截取屏幕
scrot /tmp/screen.png
# 2. 在 Claude 中查看,识别按钮的显示坐标(500, 300)
# 3. 点击该按钮
./scripts/click.sh 500 300
# 4. 如果点击位置不准,进行校准
./scripts/calibrate.sh
已在以下环境测试:Ubuntu/Debian with X11,多种分辨率和 DPI 设置