Autohotkey AHK-使用热键修改选项

Autohotkey AHK-使用热键修改选项,autohotkey,Autohotkey,是否有可能将热键设置与热键相结合? [i] 当然,不需要复制所有热字符串,也不需要在热字符串中添加额外的行[/i] 我可以想象,但只能通过复制一切。 原因: 我想用普通的空间来加热,在某种程度上,空间被添加到最后, 但是如果我想将其用作:o: 事实上,如果知道通常如何使用热键来修改某些选项,那就太好了。 而不是像这样: ::hlo:: { if alt is pressed...else ... } 编辑: 所以我们已经在Discord AHK论坛上讨论了很长一段时间了。 到目前为止,我对问

是否有可能将热键设置与热键相结合? [i] 当然,不需要复制所有热字符串,也不需要在热字符串中添加额外的行[/i] 我可以想象,但只能通过复制一切。 原因: 我想用普通的空间来加热,在某种程度上,空间被添加到最后, 但是如果我想将其用作:o: 事实上,如果知道通常如何使用热键来修改某些选项,那就太好了。

而不是像这样:

::hlo::
{
if alt is pressed...else ...
}
编辑: 所以我们已经在Discord AHK论坛上讨论了很长一段时间了。 到目前为止,我对问题不同方面的回答如下: -不能直接修改任何选项 -但可以通过特定功能动态修改热键/热键等。 -对于热字符串,一个非常新的特性是:x:abc::,它允许使用表达式->并且我们可以调用一个函数,该函数使用全局变量->通过这些变量,可以在运行之前动态调整设置。 -不过,我对这个特殊问题的最终解决方案却大不相同。我没有使用内置选项,而是更幸运地找到了一个糟糕的解决方法:

-还粘贴了一个代码@CliveGalway a.k.a EvilC?通过论坛帮助我。我不能在这种特殊情况下使用它的原因是,如果使用了:x:,热字符串将失去其自动区分大小写的功能-我不希望这样。。。其他优秀的脚本:


不太清楚你在说什么。我想如果你想


嗨,你是论坛的恶魔,对吗简而言之,我已经试着总结一下我们上面的相关讨论。对于你的这一评论,我仍然会给你一点意见,作为对我们努力的总体感谢。
~!space::send,{bs}   ;(this does not work together with the hotsrting ofcourse)
::hlo::
{
if alt is pressed...else ...
}
#inputlevel 1
!space:: 
{
        SendInput,{space}
        sleep 0
        SendInput,{bs}
return
}
#inputlevel 0
::asd::by the way
#SingleInstance force
EndCharOn := 0
SetCapsLockState, Off

hotStrings := [{hs: "btw", rep: "By the Way"}
                ,{hs: "tat", rep: "This and That"}]

for i, h in hotStrings {
    HotString(":X:" h.hs, Func("SendHotString").Bind(h.rep))
}

CapsLock::
    EndCharOn := !EndCharOn
    SetCapsState()
    return

SetCapsState(){
    global EndCharOn
    SetCapsLockState, % (EndCharOn ? "On" : "Off")
}

SendHotString(Text){
    global EndCharOn
    SendRaw, % Text (EndCharOn ? A_EndChar : "")
    EndCharOn := 0
    SetCapsState()
}

^Esc::
    ExitApp
#if GetKeyState("Alt") ; Only enable these hotstrings if Alt is held
::hlo::Hello!
::wtv::Whatever
#if