创建一个热键来触发使用 lctrl 的现有热键

问题描述 投票:0回答:1

按“b”应触发“leftControl+7”的热键

<^7:: send "success" ;left ctrl 7

b::{
    send "<^7" ;not working;  send "^7" will work for ctrl 7
}

相反,它会识别 < as a character. You put it in {<} still a character, you put it like {<^}, it doesn't recognize. And you can't send "{lctrl down}7{lctrl up}".

autohotkey autohotkey-2
1个回答
0
投票

适用于 ahk v2。

^7::
{
    Send("success")
}

b::
{
    Send("{LControl Down}7{LControl Up}")
}

enter image description here


如果你想避免直接触发

^7
,你可以使用全局变量。

Global fromTrigger := 0
^7::
{
    if !fromTrigger
        Return
    Global fromTrigger := 0
    send("sucess")
}

b::
{
    Send("{LControl Down}7{LControl Up}")
    Global fromTrigger := 1
}
© www.soinside.com 2019 - 2024. All rights reserved.