【问题标题】:AutoHotKey - how to send control and same key multiple timesAutoHotKey - 如何多次发送控制和相同的键
【发布时间】:2017-12-05 03:36:29
【问题描述】:

具体我想按住control键,然后按m键,放开m但按住control,然后再按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

都是违法的

【问题讨论】:

    标签: automation autohotkey


    【解决方案1】:

    这个呢:

    ; 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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-01-24
      • 2019-03-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多