Topics - jeff_eisenberg [ switch to compact view ]

Pages: [1]
I'm trying to complete an autohotkey script where you can double tap any SHIFT key twice and follow it by a certain letter to activate a macro.
I have the following script but i have two "bugs" i can't figure out how to solve. I've tried other forums with no luck. Hoping someone can help me out.
I'm a little new at this.

Bug 1:  The macro is activated if you press any letter in between the two SHIFTs where it should only be activated if you press the SHIFTs exclusively. For example, pressing SHIFT, s, SHIFT, d will enable the macro.

Bug 2:  I'm not sure how this happens but with the following code, I periodically get all or some of the macros to activate while i'm typing. It seems to happen when I type the first capital letter in a sentence. But only sometimes. For example... "bla bla bla profiles. S"

I've fooled around with the timeouts but that doesn't seem to make much of a difference. Any help is appreciated.


~Shift Up::
If (A_ThisHotkey == A_PriorHotkey && A_TimeSincePriorHotkey < 400)
    Double_SHIFT := true
    Sleep, 2000
    Double_SHIFT := false

; Press a key within two seconds after double tapping the Shift key, to activate an action:
#If (Double_SHIFT)
    FormatTime, CurrentDateTime,,MM/dd/yy - hh:mmtt
    SendInput %CurrentDateTime%
            Double_SHIFT :=false
    a:: MsgBox, Test
    s:: MsgBox, Test
    f:: MsgBox, Test

Pages: [1]
Go to full version