简体   繁体   English

热键多个字符

[英]HotKey multiple characters

Is it possible to define an AutoHotKey HotKey which require multiple characters to fire ?是否可以定义一个需要多个字符才能触发的 AutoHotKey热键

Example: if I write the AHK script示例:如果我编写 AHK 脚本

^j:: Send, my test return ^j:: 发送,我的测试返回

The Hotkey Control j fires off the string "my test" Hotkey Control j触发字符串“my test”

What if I wanted to require Control jBAS to fire off the script ...in this case the letters BAS following the Control j ?如果我想要求Control jBAS触发脚本……在这种情况下,字母BAS跟在Control j后面怎么办? From the examples I have seen, HotKey does not seem to allow this ...I can accomplish this with a HotString ...problem with HotString is that you must hit Enter and then the original String is replaced with the new HotString definition.从我看到的示例来看,HotKey 似乎不允许这样做...我可以使用HotString 来完成此操作 ...HotString问题是您必须按 Enter 键,然后将原始 String 替换为新的 HotString 定义。

Heres an option:这是一个选项:

^j::
Input, matchVal, C L3,, BAS
if (matchVal=="BAS") {
    Send, mytest
}
Return

Check out https://www.autohotkey.com/docs/commands/Input.htm for further data and options.查看https://www.autohotkey.com/docs/commands/Input.htm了解更多数据和选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM