While holding key "A"/"S"/"D"/"W" then press "Shift"

Ask gaming related questions (AHK v1.1 and older)
KochiroKagehara
Posts: 1
Joined: 08 May 2017, 02:37

While holding key "A"/"S"/"D"/"W" then press "Shift"

08 May 2017, 03:22

Problem:
I'm play a game that is to dodge I have to double press the movement key like "aa" "ss" "dd" "ww"
But i'm used to press "Shift + movementKey" like "Shift + A" to dodge to the left.

Script 1:
I tried to write the script but it doesn't work properly

Shift::
Send, ss
Return

For example: While holding key "A" press "Shift" but i keep holding key "A"
Result using the script: aaaaaaaaaaaaaaaaass
But what i want is like: aaaaaaaaaaaaaaaaassaaaaaaaaaaa.....








Script 2:
Another script i made but it doesn't work too:

a & Shift::
Send, aa
Return

s & Shift::
Send, ss
Return

d & Shift::
Send, dd
Return

w & Shift::
Send, ww
Return

This script work when I press A+Shift
But i can not hold/press A anymore.

Please help me, thank you very much!
neomulemi6
Posts: 216
Joined: 30 Jun 2016, 06:01

Re: While holding key "A"/"S"/"D"/"W" then press "Shift"

08 May 2017, 10:11

I can't test this, but it should work. + = shift.

Code: Select all

SetKeyDelay, 0, 50

+a::Send {a 2}
+s::Send {s 2}
+d::Send {d 2}
+w::Send {w 2}
itsyeboiC0smin
Posts: 2
Joined: 25 Jun 2018, 16:55

Re: While holding key "A"/"S"/"D"/"W" then press "Shift"

25 Jun 2018, 17:15

this works i use it in fortnite

Code: Select all

~w::
While GetKeyState("w", "P")
Send, {shift down}
KeyWait, w
    Send, {Shift up}
return

~a::
While GetKeyState("a", "P")
Send, {shift down}
KeyWait, a
    Send, {Shift up}
return

~s::
While GetKeyState("s", "P")
Send, {shift down}
KeyWait, s
    Send, {Shift up}
return

~d::
While GetKeyState("d", "P")
Send, {shift down}
KeyWait, d
    Send, {Shift up}
return
itsyeboiC0smin
Posts: 2
Joined: 25 Jun 2018, 16:55

Re: While holding key "A"/"S"/"D"/"W" then press "Shift"

25 Jun 2018, 17:15

this works i use it in fortnite

Code: Select all

~w::
While GetKeyState("w", "P")
Send, {shift down}
KeyWait, w
    Send, {Shift up}
return

~a::
While GetKeyState("a", "P")
Send, {shift down}
KeyWait, a
    Send, {Shift up}
return

~s::
While GetKeyState("s", "P")
Send, {shift down}
KeyWait, s
    Send, {Shift up}
return

~d::
While GetKeyState("d", "P")
Send, {shift down}
KeyWait, d
    Send, {Shift up}
return

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 53 guests