![Autohotkey 具有熱鍵和熱字串](https://rvso.com/image/1421892/Autohotkey%20%E5%85%B7%E6%9C%89%E7%86%B1%E9%8D%B5%E5%92%8C%E7%86%B1%E5%AD%97%E4%B8%B2.png)
如何允許重新映射的熱鍵觸發熱字串,以便它們在 Autohotkey 中工作?
r::Send e
::ee::by the way
這樣,當我按下鍵盤上的 rr 時,它會列印「順便說一句」。
目前它僅在按 ee 時才列印。
注意:我想要一個不涉及分配多個觸發縮寫來擴展為相同字串的解決方案。
答案1
如果您使用 AHK v1.1+,則可以使用#InputLevelhttp://ahkscript.org/docs/commands/_InputLevel.htm
::ee::by the way
#InputLevel, 1
r::Send e
答案2
使用這個代替:
r::發送 {ASC 0101} ::ee::順便說一下 ::rr::順便說一下
答案3
這是一個代碼:
r::
Loop
{
b:=GetKeyState("r")
if (b !=1)
{
ccounter := 1
Loop
{
c:=GetKeyState("r")
if (c=1)
{
MsgBox, by the way
return
}
Sleep, 50
ccounter:= ccounter + 1
if (ccounter = 60)
{
return
}
}
}
}
return
r按兩次時會彈出訊息框「順便」 。但兩次r按下之間的時間不應超過 3 秒。您可以透過變更來調整該時間ccounter = 60
。其中每個值等於 50 毫秒(1000 毫秒 = 1 秒)。
另外,請務必使用 AutoHotkey 及其文檔http://ahkscript.org/(目前最新版本,新官網)! AutoHotkey 及其來自 autohotkey.com 的文件已過時,您在使用它們時可能會遇到一些問題!
答案4
這將起作用:
:*:rr::
Goto ::ee
return
::ee::
Send by the way
return