Automation 自动热键-如何多次发送控件和同一个键

Automation 自动热键-如何多次发送控件和同一个键,automation,autohotkey,Automation,Autohotkey,具体来说,我想按住控制键,然后按m键,放开m,但保持控制,然后再次按m,这将触发该功能。更一般地说,我想知道告诉autohotkey多次读取同一个键的语法 我该怎么做 我可以用一个像这样的m来做 ^m:: Send, The text i want to send Return 到目前为止我已经试过了 ^m m:: Send, The text i want to send Return ^m&m:: Send, The text i want to send Retur

具体来说,我想按住控制键,然后按m键,放开m,但保持控制,然后再次按m,这将触发该功能。更一般地说,我想知道告诉autohotkey多次读取同一个键的语法

我该怎么做

我可以用一个像这样的m来做

^m::
  Send, The text i want to send
Return
到目前为止我已经试过了

^m m::
  Send, The text i want to send
Return

^m&m::
  Send, The text i want to send
Return

^mm::
  Send, The text i want to send
Return
所有这些都是非法的

那么:

; Depending on how many times a key combination was pressed, 
; execute different commands:

^m::
    ctrl_m_count++          ; start counter
    SetTimer ctrl_m_action, -50
return

ctrl_m_action:
    KeyWait, Ctrl
    If (ctrl_m_count = 1)
        MsgBox, ctrl_m_action 1
    If (ctrl_m_count = 2)
        MsgBox, ctrl_m_action 2
    ; ...
    ctrl_m_count := 0       ; reset  counter
return