autohotkey - 按住人民币后按钮并点击
问题描述
我想不通。
我正在尝试完成这样的事情:
- 按下 GUI 按钮
- 当我单击鼠标下一步时按住人民币
- 当我再次点击释放人民币
目前的工作:
Toggle=0
GUI, Add, Button, w50 h50, Nbutton
GUI, Show, x50 y50
return
ButtonNButton:
{
Toggle:=!Toggle
}
if GetKeyState("LButton","P")
if (Toggle == 1)
MsgBox, Do
Toggle:=!Toggle
return
解决方案
这应该可以完成你想要的。
请注意,目前,此示例脚本仅限于在记事本中工作。您应该更新脚本以针对您希望热键处于活动状态的任何程序/游戏/窗口。
Toggle := 0
GUI, Add, Button, w50 h50, Nbutton
GUI, Show, x50 y50
return
ButtonNButton:
Toggle:=!Toggle
; Update this line to match whatever window you want the hotkey active
; in, or delete this line to make the hotkey active everywhere.
Hotkey, IfWinActive, ahk_class Notepad
if Toggle
{
Hotkey, ~*LButton Up, RBSwitch, On
}
else
{
if GetKeyState("RButton") ;release RButton when hotkey is disabled
Send {RButton Up}
Hotkey, ~*LButton Up, RBSwitch, Off
}
RETURN
RBSwitch:
if GetKeyState("RButton")
Send {RButton Up}
else
Send {RButton Down}
RETURN
推荐阅读
- javascript - 从Commerce js获取数据时获取元命名对象
- c - 恢复问题:文件格式不支持错误
- javascript - 通过 JavaScript 将鼠标悬停在部分 div 上时显示工具提示
- html - Angular:在 HTML 中动态创建组件不起作用
- c# - 收件人域不匹配 Mailchimp
- javascript - 如果用户在 Chrome 上设置“Web 内容的强制暗模式”,如何禁用?
- python - 使用正则表达式获取年龄
- google-cloud-transcoder - 单个转码时间是 VS 全部在谷歌云中的单个作业/配置文件中完成的 2-3 倍
- c# - 在 linq 语句中使用具有多个参数的表达式
- python-3.x - 如何使用本地 Python 脚本读取实时 AWS Lambda 日志?