HiDPI Mouse Skill
Universal mouse coordinate handling for desktop automation across different screen configurations.
🚀 Quick Start
CODEBLOCK0
📐 How It Works
When Claude displays a screenshot, it scales it down. This skill converts coordinates:
CODEBLOCK1
The scale factor depends on:
- - Screen resolution (1080p, 1440p, 4K, etc.)
- DPI settings (96, 144, 192, etc.)
- Claude's display viewport
🔧 Scripts
click.sh - Click at coordinates
CODEBLOCK2
calibrate.sh - Setup & Configuration
CODEBLOCK3
detect-scale.sh - Get scale factor
CODEBLOCK4
Other scripts
CODEBLOCK5
🎯 Calibration (Recommended for New Systems)
For best accuracy on your specific system:
CODEBLOCK6
This will:
- 1. Create a calibration image with markers at known positions
- Ask you where the markers appear in Claude's display
- Calculate and save the exact scale factor
📊 Common Scale Factors
| Screen | DPI | Typical Scale |
|---|
| 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 |
🔍 Troubleshooting
Clicks are offset
CODEBLOCK7
Check current configuration
CODEBLOCK8
Reset everything
CODEBLOCK9
📁 Configuration Files
- -
~/.config/hidpi-mouse/scale.conf - User-set scale (highest priority) - INLINECODE1 - Auto-detected scale cache (1 hour TTL)
🌐 Universal Compatibility
This skill auto-adapts to:
- - ✅ Different screen resolutions (1080p to 4K+)
- ✅ Different DPI settings (96, 120, 144, 192, etc.)
- ✅ HiDPI/Retina displays
- ✅ Multi-monitor setups (primary display)
💡 Usage Tips
- 1. Always calibrate on a new system for 100% accuracy
- Re-calibrate if you change display settings
- Use
--raw if you already have screen coordinates - Check
calibrate.sh info to see current settings
📝 Example Workflow
CODEBLOCK10
Tested on: Ubuntu/Debian with X11, various resolutions and DPI settings
HiDPI鼠标技能
跨不同屏幕配置的桌面自动化通用鼠标坐标处理。
🚀 快速开始
bash
点击Claude显示坐标(自动缩放)
./scripts/click.sh 500 300
首次使用?运行校准以获得最佳精度
./scripts/calibrate.sh
📐 工作原理
当Claude显示截图时,会将其缩小。本技能转换坐标:
Claude显示坐标 → 缩放因子 → xdotool屏幕坐标
缩放因子取决于:
- - 屏幕分辨率(1080p、1440p、4K等)
- DPI设置(96、144、192等)
- Claude的显示视口
🔧 脚本
click.sh - 点击坐标
bash
./scripts/click.sh
# 自动缩放点击
./scripts/click.sh --raw # 无缩放(屏幕坐标)
./scripts/click.sh --double # 双击
./scripts/click.sh --right # 右键点击
calibrate.sh - 设置与配置
bash
./scripts/calibrate.sh # 交互式校准
./scripts/calibrate.sh info # 显示当前配置
./scripts/calibrate.sh test # 测试当前缩放
./scripts/calibrate.sh set 2.08 # 手动设置缩放
./scripts/calibrate.sh reset # 重置为自动检测
detect-scale.sh - 获取缩放因子
bash
./scripts/detect-scale.sh # 返回缩放值(例如 2.08)
其他脚本
bash
./scripts/move.sh # 移动鼠标
./scripts/drag.sh # 拖拽
./scripts/reliable_click.sh [--window 名称 --relative]
🎯 校准(新系统推荐)
为您的特定系统获得最佳精度:
bash
./scripts/calibrate.sh
这将:
- 1. 创建带有已知位置标记的校准图像
- 询问您在Claude显示中标记出现的位置
- 计算并保存精确的缩放因子
📊 常见缩放因子
| 屏幕 | 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 |
🔍 故障排除
点击偏移
bash
运行校准
./scripts/calibrate.sh
或手动调整
./scripts/calibrate.sh set 2.1 # 尝试不同值
检查当前配置
bash
./scripts/calibrate.sh info
重置所有设置
bash
./scripts/calibrate.sh reset
rm -f /tmp/hidpiscalecache
📁 配置文件
- - ~/.config/hidpi-mouse/scale.conf - 用户设置缩放(最高优先级)
- /tmp/hidpiscalecache - 自动检测缩放缓存(1小时TTL)
🌐 通用兼容性
本技能自动适配:
- - ✅ 不同屏幕分辨率(1080p到4K+)
- ✅ 不同DPI设置(96、120、144、192等)
- ✅ HiDPI/Retina显示屏
- ✅ 多显示器设置(主显示器)
💡 使用技巧
- 1. 始终在新系统上校准以获得100%精度
- 重新校准如果更改了显示设置
- 使用--raw如果您已有屏幕坐标
- 检查calibrate.sh info查看当前设置
📝 示例工作流程
bash
1. 截取屏幕截图
scrot /tmp/screen.png
2. 在Claude中查看,识别显示坐标(500, 300)处的按钮
3. 点击它
./scripts/click.sh 500 300
4. 如果点击不准,进行校准
./scripts/calibrate.sh
已在以下环境测试:Ubuntu/Debian with X11,各种分辨率和DPI设置