双击SHIFT键后跟一个字母

时间:2017-04-17 19:07:41

标签: autohotkey

我希望能够双击一个SHIFT键,后跟一个字母来激活一个动作。有人可以帮忙吗?能够双击任一SHIFT键会很高兴。

像是什么?

< +< +或> +> +然后d 做一点事 返回

~Shift Up::
If (A_ThisHotkey == A_PriorHotkey && A_TimeSincePriorHotkey < 500)
{
    Double_SHIFT := true
    Sleep, 2000
    Double_SHIFT := false
}
return

; Press a key within two seconds after double tapping the Shift key, to activate an action:

#If (Double_SHIFT)
    a:: MsgBox, This macro has not yet been enabled. Contact IT for suggestions.
    b:: FormatTime, CurrentDateTime,,MM/dd/yy - hh:mmtt
    SendInput %CurrentDateTime%
    c:: MsgBox, This macro has not yet been enabled. Contact IT for suggestions.
return

2 个答案:

答案 0 :(得分:2)

~Shift Up::
If (A_ThisHotkey == A_PriorHotkey && A_TimeSincePriorHotkey < 500)
{
    Double_SHIFT := true
    ToolTip, Double_SHIFT     ; remove this line, if you don't want a tooltip displayed
    Sleep, 2000
    Double_SHIFT := false
    ToolTip                   ; remove this line, if you don't want a tooltip displayed
}
return

; Press a key within two seconds after double tapping the Shift key, to activate an action:

#If (Double_SHIFT)

    a:: MsgBox, Double_SHIFT + a

    b:: MsgBox, Double_SHIFT + b

#If

答案 1 :(得分:0)

shift shift d 按下时显示消息框

~LShift::ShiftPressed()
~RShift::ShiftPressed()
$d::DPressed()

ShiftPressed()
{
  global t1,t2
  t1 := t2
  t2 := A_TickCount
}

DPressed()
{
  global t1,t2
  if (A_TickCount < t1 + 1000) && (A_TickCount < t2 + 1000)
     MsgBox Shift Shift D Pressed
  else
    sendinput d
}