Double tap key + hold

Ask gaming related questions
DracoCapt
Posts: 1
Joined: 17 May 2024, 01:52

Double tap key + hold

17 May 2024, 02:05

Hello, I'm trying to make a ahk script that works when I press w and hold it presses w again and also hold until I release w.
Is that possible? I tried making it on my own but to no avail because I think it's looping itself when I press w. Or I have to just make a keybind that double presses w and hold
User avatar
boiler
Posts: 17390
Joined: 21 Dec 2014, 02:44

Re: Double tap key + hold

17 May 2024, 02:40

Try this:

Code: Select all

#Requires AutoHotkey v2.0

~$w:: {
	Send '{w down}'
	KeyWait 'w'
	Send '{w up}'
}
User avatar
mikeyww
Posts: 27366
Joined: 09 Sep 2014, 18:38

Re: Double tap key + hold

23 May 2024, 06:47

A variation is below.

Code: Select all

#Requires AutoHotkey v2.0

$w:: {
 Send 'w'
 If !KeyWait('w', 'T.3') {
  Send '{w down}'
  SoundBeep 1500
  KeyWait 'w'
  Send '{w up}'
  SoundBeep 1000
 }
}

Return to “Gaming”

Who is online

Users browsing this forum: Draken and 5 guests