Combining long press and double tapping scripts

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Joey5
Posts: 97
Joined: 19 May 2023, 05:25

Combining long press and double tapping scripts

06 Apr 2024, 18:23

Hi all,
The following two scripts work well separately but not together. Any chance of combining it so that one script can send short press/single tap, long press, double tap and triple press?
Thank you in advance.

Code: Select all


#IFWinActive, ahk_exe notepad.exe
d::
 {
   count++
   settimer, actions, 350
 }
return

actions:
 {
   if (count = 1)
    {
      send d
    }
   else if (count = 2)
    {
      send e
    }
   else if (count = 3)
    {
      send f
    }
   count := 0
 }
return
#IFWinActive

Code: Select all

#IFWinActive, ahk_exe notepad.exe
$d::
keywait, d, T0.5
if errorlevel {
	SoundBeep
	Send e
} else Send d
keywait, d
; d key down would immediately trigger $d:: again
return
#IFWinActive
Last edited by gregster on 06 Apr 2024, 19:14, edited 1 time in total.
Reason: Fixed code tags once again. These tags should go around the code.
User avatar
flyingDman
Posts: 2832
Joined: 29 Sep 2013, 19:01

Re: Combining long press and double tapping scripts

06 Apr 2024, 18:31

Try Morse: viewtopic.php?f=76&t=127450&p=563668&hilit=morse#p563668
V2 example
14.3 & 1.3.7
Joey5
Posts: 97
Joined: 19 May 2023, 05:25

Re: Combining long press and double tapping scripts

06 Apr 2024, 19:10

@flyingDman thank you. I am hoping to avoid using a modifier key.
User avatar
flyingDman
Posts: 2832
Joined: 29 Sep 2013, 19:01

Re: Combining long press and double tapping scripts

06 Apr 2024, 19:16

My example includes one but it does not require one.
14.3 & 1.3.7

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: arrondark, Bing [Bot], Spawnova and 65 guests