在 AutoHotkey 中按住鼠标左键 [英] Holding down the left mouse button in AutoHotkey

查看:46
本文介绍了在 AutoHotkey 中按住鼠标左键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一个脚本,其中按 F1 使 AutoHotkey 按住鼠标左键.然后我希望脚本在我再次按下该键时释放鼠标.

I want a script where pressing F1 makes AutoHotkey hold down the left mouse button. I then want the script to release the mouse once I press the key again.

我该怎么做?

推荐答案

我会使用 Click down and Click up

I would use Click down and Click up

点击 通常优于 MouseClick 因为如果用户通过系统的控制面板交换了左右鼠标按钮,它会自动补偿.

Click is generally preferred over MouseClick because it automatically compensates if the user has swapped the left and right mouse buttons via the system's control panel.

F1::
    alt := not alt
    if (alt)
    {
        Click down
    }
    else
    {
        Click up
    }
Return

这篇关于在 AutoHotkey 中按住鼠标左键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆