Autohotkey 自动热键-虚拟键盘/自动输入

Autohotkey 自动热键-虚拟键盘/自动输入,autohotkey,Autohotkey,我在Autohotkey中有一个简单的脚本: :*:teams:: ( milan juventus inter roma lazio napoli mantova ) 当我在记事本上键入球队时,我的输出是球队列表(米兰、尤文图斯……) 如果我使用一个物理键盘输入,这个脚本对我有用 ,但如果使用虚拟键盘键入团队,我在记事本上没有列表: 如果我运行脚本自动键入teams WinWait, *new 2 - Notepad++, IfWinNotActive, *new 2 - Note

我在Autohotkey中有一个简单的脚本:

:*:teams::
(
milan
juventus
inter
roma
lazio
napoli
mantova
)
当我在记事本上键入球队时,我的输出是球队列表(米兰、尤文图斯……)
如果我使用一个物理键盘输入,这个脚本对我有用

,但如果使用虚拟键盘键入团队,我在记事本上没有列表:

如果我运行脚本自动键入teams

WinWait, *new  2 - Notepad++, 
IfWinNotActive, *new  2 - Notepad++, , WinActivate, *new  2 - Notepad++, 
WinWaitActive, *new  2 - Notepad++, 
MouseClick, left,  133,  117
Sleep, 100
Send, squadre
脚本不会将团队替换为团队列表

为什么脚本只有在使用物理键盘键入时才能工作?
有没有一种不用物理键盘就用脚本替换单词、句子的解决方案?


对不起,如果我是noob

您可以使用
输入
命令

loop {
    While !RegexMatch(strCapture, "teams$") {
        Input, strUserInput, V L1, {BackSpace}  ; V: visible, L1: Character length 1
        If ErrorLevel = Endkey:BackSpace
            strCapture := SubStr(strCapture, 1, StrLen(strUserInput) - 1) 
        else
            strCapture .= strUserInput
        ; tooltip % ErrorLevel "`n" strUserInput "`n" strCapture "`n" ; enable this to see what actually happens
    }
    SendInput,
    (Ltrim
        {Backspace 5}
        milan
        juventus
        inter
        roma
        lazio
        napoli
        mantova
    )
    strCapture := ""
}

对非常感谢。现在它可以同时使用虚拟键盘和发送命令。也可以运行集成“复制粘贴”的脚本?我发布了一个关于send命令类似问题的类似问题,你能再次帮助我吗?谢谢,还有一件事。我如何修改代码,用其他单词替换2,3个单词?在您的代码版本中,我只能替换一个单词。您能帮我吗?@user149018要替换字符串,您可以使用
RegexReplace()
StringReplace
。我希望你能开始一个新的问题。你链接的问题有点长,里面有多个问题。这使得回答者更难回答。因此,我建议你在一篇文章中尽可能少地提出问题。好的,请看这里以替换不同的单词/句子: