Skip to content

Instantly share code, notes, and snippets.

@selivan
Last active April 22, 2026 22:50
Show Gist options
  • Select an option

  • Save selivan/01472ac68bd7f060fc5818db0f6deeaf to your computer and use it in GitHub Desktop.

Select an option

Save selivan/01472ac68bd7f060fc5818db0f6deeaf to your computer and use it in GitHub Desktop.
Auhotkey script to toggle auto moving forward(holding W) in games with CapsLock. Pressing W or S or left mouse stops it.
; Vibecoded with ChatGPT
; Licence: WTFPL
#Requires AutoHotkey v2.0
#Warn All
autoRunActive := false
TraySetIcon("imageres.dll", 112)
StartRunning()
{
global autoRunActive
autoRunActive := true
Send("{w down}")
}
StopRunning()
{
global autoRunActive
Send("{w up}")
autoRunActive := false
}
StopRunning()
CapsLock::
{
global autoRunActive
if (autoRunActive)
StopRunning()
else
StartRunning()
}
w::
{
global autoRunActive
if (autoRunActive)
StopRunning()
Send("{w down}")
}
w up::
{
Send("{w up}")
}
s::
{
global autoRunActive
if (autoRunActive)
StopRunning()
Send("{s down}")
}
s up::
{
Send("{s up}")
}
~LButton::
{
global autoRunActive
if (autoRunActive)
StopRunning()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment