AutoHotKey 获取鼠标实时位置

效果展示

安装autohotkey,创建.ahk文件,写入示例代码,双击启动脚本即可。

示例 1

cpp 复制代码
SetTimer WatchCursor, 10
WatchCursor() {
    MouseGetPos &xpos, &ypos
    ToolTip("鼠标位置:" "(" xpos "," ypos ")")
}

示例2

可以用热键Ctrl Shift M 启用/关闭:

cpp 复制代码
isTimerRunning := false
; Ctrl Shift M
^+M:: {
    global isTimerRunning
    if (isTimerRunning) {
        SetTimer WatchCursor, 0
        ToolTip
        isTimerRunning := false
    } else {
        SetTimer WatchCursor, 10
        isTimerRunning := true
    }
}

WatchCursor() {
    MouseGetPos &xpos, &ypos
    ToolTip("(" xpos "," ypos ")")
}
相关推荐
三少爷的鞋3 小时前
很多开发者把物理上的分层,当成了架构
android
FungLeo4 小时前
FengCMS · PHP+MySQL 升级实录 · MySQL DDL不能回滚:模型字段结构操作的失败续做
android·mysql·php·工程实践·fengcms
雨白5 小时前
Android 建造者模式实战:从 AlertDialog 源码到 TopBar 的两种实现
android
_祝你今天愉快7 小时前
Android 高级绘制:[五] 贝塞尔曲线与计算规则
android
FungLeo1 天前
FengCMS · PHP+MySQL 升级实录 · 危险默认值之殇:root/123456、认证码 8888 写进配置加载器
android·mysql·php·安全加固·fengcms
yz_aiks1 天前
Termux 使用教程:把安卓手机变成随身 Linux(装 Python、SSH 远程、跑自动化脚本)
android·linux·python·智能手机·ssh·termux
booboosui1 天前
编号没变,消息还是来了:Mac 端通知读取漏第二条的原因
android
雨白2 天前
单例设计模式:从 Java/Kotlin 实现到 Android 实战
android
hai_android2 天前
一行 asLiveData,背后是一座生命周期的桥
android·java·kotlin
阿杰m2 天前
Android源码第二十三章:Telephony、RIL 与 IMS——来电怎么到应用?
android