将几个热键组合成热字符串

时间:2017-03-19 19:05:18

标签: autohotkey

我知道hotstrings:

; If I press `d` key three times, there should be inserted current date and time

:*:ddd::
FormatTime, CurrentDateTime,, dd.MM.yyyy HH:mm
SendInput, %CurrentDateTime%
return

我想要的是为热键复制它,即将几个热键组合成热字符串。

这是一个简单的热键:

+Home::
SendInput, Foo
return

这就是我想要实现的目标:

; Press `Shift-Home` twice to send `Bar`

:*:+Home+Home::
SendInput, Bar
return

1 个答案:

答案 0 :(得分:1)

参见SetTimer-Example #3 或者用这个:

+Home::
count++    ; for each press, increment a counter
If (count=1)
    SetTimer send_text, -500
return

send_text:
KeyWait, Shift, L
If (count=1)
    SendInput, one
If (count=2)
    SendInput, two
If (count=3)
    SendInput, three
; ...
count:=0      ; reset counter
return