different actions for the "." key

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
John1
Posts: 236
Joined: 11 May 2020, 11:54

different actions for the "." key

Post by John1 » 16 Apr 2022, 12:58

Hello,

I have this, when i press a key one, two times or longer it does different actions.
How could i write this the "." "," "-" keys?

Thank you!

Code: Select all

;A (A)
A::
    KeyWait, A , T0.1

    if (ErrorLevel)
        gosub GoSub_10_A3        ;Long

    else {
        KeyWait, A, D T0.1      

        if (ErrorLevel)            ; 1x
            gosub GoSub_10_A1

        else
            gosub GoSub_10_A2   ; 2x
    }

    KeyWait, A
    
return

GoSub_10_A1:
SoundBeep
return


GoSub_10_A2:
SoundBeep
return


GoSub_10_A3:
SoundBeep
return
;E (A)

User avatar
flyingDman
Posts: 2817
Joined: 29 Sep 2013, 19:01

Re: different actions for the "." key

Post by flyingDman » 16 Apr 2022, 13:12

See here: viewtopic.php?f=76&t=102270

My favorite is Morse() https://www.autohotkey.com/board/topic/15574-morse-find-hotkey-press-and-hold-patterns/ , an oldie

Code: Select all

$.::
   p := Morse()
   If (p = "0")
		send, .
   If (p = "00")
		send, `,
   If (p = "000")
		send, -
Return
14.3 & 1.3.7

John1
Posts: 236
Joined: 11 May 2020, 11:54

Re: different actions for the "." key

Post by John1 » 16 Apr 2022, 13:22

@flyingDman
Thanks a lot for your reply!

John1
Posts: 236
Joined: 11 May 2020, 11:54

Re: different actions for the "." key

Post by John1 » 19 May 2022, 05:27

@flyingDman

I tried with your method. I did not understand how to make it that fast like my version with T0.1.

Thank you!

Post Reply

Return to “Ask for Help (v1)”