1
votes

In AutoHotkey, how can I do the following:

While SPACE and "either or a combination of [A, S, D, W]" are pressed down at the same time, send key LSHIFT every X milliseconds; do this until SPACE and and A, S, D, W are not pressed.

I'm a beginner. I tried multiple ways, but it didn't work at all.

Any help would be much appreciated!

I tried this, it does nothing:

q::

Loop
{
If GetKeyState("Space", "P") && GetKeyState("w", "P")

{
Send, {LShift}
Sleep, 500

If Not GetKeyState("Space", "P") && GetKeyState("w", "P")

 {
  Pause
  }

}

}

1

1 Answers

2
votes

Try this

x := 500 ;your x

~Space::
sleep, 500  ;this is extra time given to you and not X . Dont Edit.
loop,
{
if GetKeyState("W","p") or GetKeyState("A","p") or GetKeyState("S","p") or GetKeyState("D","p")
    Send, {LShift}
else
    break
sleep, x
}
return

Enjoy