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

查看:881
本文介绍了按住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

点击 .com/docs/commands/MouseClick.htm"rel =" nofollow noreferrer> 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天全站免登陆