我在使用 Ahk 的热键时遇到问题。 我使用此代码来激活 if
activated = 1
一段代码
l::
if (activated = 1)
{
send, Hello there
}
else
send, l
问题是如果
activated = 0
l 键不会按下,因为它会自行激活。
有谁知道如何解决它?
谢谢SpaceBroetchen
正如另一个答案中提到的,更好的解决方案是使用 #If 指令使热键上下文敏感。
那么就不需要else语句来执行普通的按下了:
#If (activated = 1)
$l::SendInput, Hello there
#If ; turn off context sensitivity