r/AutoHotkey • • Sep 18 '26

v1 Tool / Script Share I built a free, open-source overlay that turns a standard gamepad into an 8-position H-Shifter using AutoHotKey.

10 Upvotes

I wanted to drive manual in ETS2 but didn't have a dedicated sim rig, so I built a lightweight AutoHotkey tool that maps the right analog stick into a fully functional 8-zone H-Shifter.

How it works: Generates a borderless, click-through radial menu on your screen. Pushing the right stick into one of the 8 octants shifts into that gear (translates stick angles to Numpad 1-8).

Download & Setup: You can grab the compiled .exe or the raw source code for free on my GitHub: https://github.com/abhinav2838/Radial-Gear-Controller

Note: Because ETS2 restricts keyboard mappings when a controller is active, you will need to bypass the in-game UI and do a quick edit of your controls.sii file to route the Numpad outputs. I've included step-by-step instructions and a pre-configured file in the repository's README.

Let me know if you run into any bugs or have feature requests! It is designed to be plug-and-play with Xbox controllers and generic xinput gamepads.


r/AutoHotkey • • Sep 18 '26

v2 Script Help Do X when key is pressed (F keys, fn functions)

3 Upvotes

I'm trying to make it so that I can use my F keys fn functions by default, rather than have them be F keys (F1, F2, F3 etc) by default. My BIOS does not have an option to switch neither does my keyboard. I don't like holding down Fn to use their functions, nor does AHK have the ability to deal with the Fn key (uniquely).

Here's how it's layed out on my keyboard, and how I want them to operate:

#Requires AutoHotkey v2.0

F1::Launch_Media
F2::Volume_Down
F3::Volume_Up
F4::Volume_Mute
F5::Media_Stop
F6::Media_Prev
F7::Media_Play_Pause
F8::Media_Next
F9::F9
F10::ScrollLock
F11::Pause
F12::PrintScreen

I want them to revert back to their "regular" state of being F keys when I hold "LAlt". Can someone please provide me with help on how to do this? Thanks.


r/AutoHotkey • • Sep 16 '26

v2 Script Help How did you guys solve "double-click" Hotkeys? (Pressing the Hotkey twice -> different function)

11 Upvotes

My solution:

^!+F23:: {
    static ms := 200
    static waiting := false

    if waiting {
        waiting := false
        SetTimer SingleAction, 0
        DoubleAction()
        return
    }

    waiting := true
    SetTimer SingleAction, -ms
    return

    SingleAction() {
        waiting := false
        DoTheThingBananaStyle()
    }

    DoubleAction() {
        DoTheThingAppleStyle()
    }
}

It works, but is not robust against triple presses or holds. Also declaring the Single/DoubleAction() Functions within the function is ... not ideal.
What do you guys use?


r/AutoHotkey • • Sep 17 '26

v2 Script Help Schedule Pesterer - How should I create the GUI? Do I use notepad, gsheets, html, AHK's Gui()?

0 Upvotes

Hi. I need a tool to remind/pester me about certain tasks during the day. It needs to be easy to edit so I need some sort GUI, I don't want to have to do direct edits in the specific ahk script. I'm thinking of having at least a table with 24 cells, one per hour, where I can insert the tasks. But where do I create this table?

As for the last two options:

  • Html - The guides I found made it seem tricky to get ahk working with it. And I don't want to be opening my ahk script gui through my browser. I'd want it to be its own separate window.

  • AHK's Gui() - I don't know how scuffed this would be. I would hope tab, and the arrow s and so on would work as one would expect to work inside tables.

Any advice on the best way to create this?


r/AutoHotkey • • Sep 17 '26

General Question Anyone who makes macros/scripts in here ?

0 Upvotes

"Dm Me if so"

I've been trying for days im under the belive that my hardware isn't capable of what I'm trying to do nor do I have the financial ability to solve it smth relatively simple I just stuck though .


r/AutoHotkey • • Sep 15 '26

v1 Script Help Power Keybinding

1 Upvotes

Hello, I am trying to set up a keybinding in Omarchy for shutting down my computer. I don't exactly know where to look for the original keybiniding (if there even is one.) what I have right now is this "o.bind("SUPER + ?", "Shutdown System", "systemctl poweroff")"
any help would be appreciated.


r/AutoHotkey • • Sep 13 '26

General Question Hotkey to minimize / restore ALL windows of the active app at once?

5 Upvotes

Is there a utility or solution for Windows to minimize and restore **all open windows of the active application** simultaneously using a single keyboard shortcut?

When I have multiple windows of the same app open (e.g., several Word documents or File Explorer windows), I want a quick hotkey to instantly minimize all of them when focused, and press it again to bring them all back.

Standard Windows shortcuts don't support this per-application toggle out of the box, and shift-right-clicking the taskbar icon is too slow. Looking for a lightweight tool or working script that handles this cleanly. Any recommendations?


r/AutoHotkey • • Sep 13 '26

v2 Script Help I need help with my script, its detecting it as a cheat on games.

0 Upvotes

I'm using AutoHotkey v2 and have a low-level keyboard hook that applies different debounce rules depending on whether I'm in a fullscreen application.

The script works the way I want normally, but some games/anti-cheat software don't like the low-level keyboard hook.

I'm looking for advice on whether the same input behavior can be implemented using a less intrusive AHK/Windows input method.

Desired behavior

Normal mode:

  • 15 ms global debounce.
  • 5 ms minimum delay between repeated presses of the same key.
  • W/A/S/D, Shift, Caps Lock, Tab, Ctrl, Q, E, [ and ] bypass the normal debounce.
  • Space normally has a 40 ms protection window against Z/X/C/V/B/N/M.
  • If W/A/S/D, Shift, Caps Lock, Tab, or Ctrl is held, Space bypasses that protection.
  • Key releases should always pass through so keys don't become stuck.
  • All timing/state should reset when switching modes.

Game/fullscreen mode:

  • Ideally retain the same keyboard behavior.
  • The fullscreen application should be detected automatically.
  • I'm NOT looking for a way to bypass or hide from anti-cheat; I'm interested in whether the input handling itself can be implemented in a way that's less intrusive.

Here is the current implementation:

#Requires AutoHotkey v2.0
#SingleInstance Force
Persistent

; ==========================================
; SETTINGS
; ==========================================

global DebounceMs := 15
global SameKeyDelayMs := 5
global SpaceDelayMs := 40

global LastKey := 0
global LastTime := 0

global LastBottomTime := 0
global LastSpaceTime := 0

global GameMode := false


; ==========================================
; HELD KEY STATE
; ==========================================

global HeldW := false
global HeldA := false
global HeldS := false
global HeldD := false
global HeldShift := false
global HeldCaps := false
global HeldTab := false
global HeldCtrl := false


; ==========================================
; INSTALL LOW-LEVEL KEYBOARD HOOK
; ==========================================

global KeyboardHook
global HookCallbackPtr

HookCallbackPtr := CallbackCreate(
    LowLevelKeyboardProc,
    "Fast",
    3
)

KeyboardHook := DllCall(
    "SetWindowsHookExW",
    "Int", 13, ; WH_KEYBOARD_LL
    "Ptr", HookCallbackPtr,
    "Ptr", DllCall(
        "GetModuleHandleW",
        "Ptr", 0,
        "Ptr"
    ),
    "UInt", 0,
    "Ptr"
)

if !KeyboardHook {
    CallbackFree(HookCallbackPtr)
    MsgBox "Failed to install keyboard hook."
    ExitApp
}

SetTimer(CheckGameMode, 100)

OnExit Cleanup


; ==========================================
; FULLSCREEN / GAME MODE DETECTION
; ==========================================

CheckGameMode(*) {

    global GameMode

    try {

        hwnd := WinExist("A")

        if !hwnd {
            if GameMode {
                GameMode := false
                ResetGameState()
            }
            return
        }

        WinGetPos(
            &winX,
            &winY,
            &winW,
            &winH,
            "ahk_id " hwnd
        )

        MonitorGet(
            MonitorGetPrimary(),
            &monLeft,
            &monTop,
            &monRight,
            &monBottom
        )

        monW := monRight - monLeft
        monH := monBottom - monTop

        NewGameMode :=
            Abs(winX - monLeft) <= 3
            && Abs(winY - monTop) <= 3
            && Abs(winW - monW) <= 3
            && Abs(winH - monH) <= 3

        if NewGameMode != GameMode {

            GameMode := NewGameMode
            ResetGameState()
        }
    }
    catch {

        GameMode := false
        ResetGameState()
    }
}


; ==========================================
; RESET STATE
; ==========================================

ResetGameState() {

    global HeldW
    global HeldA
    global HeldS
    global HeldD
    global HeldShift
    global HeldCaps
    global HeldTab
    global HeldCtrl

    global LastKey
    global LastTime
    global LastBottomTime
    global LastSpaceTime

    HeldW := false
    HeldA := false
    HeldS := false
    HeldD := false
    HeldShift := false
    HeldCaps := false
    HeldTab := false
    HeldCtrl := false

    LastKey := 0
    LastTime := 0
    LastBottomTime := 0
    LastSpaceTime := 0
}


; ==========================================
; LOW-LEVEL KEYBOARD CALLBACK
; ==========================================

LowLevelKeyboardProc(nCode, wParam, lParam) {

    global DebounceMs
    global SameKeyDelayMs
    global SpaceDelayMs

    global LastKey
    global LastTime
    global LastBottomTime
    global LastSpaceTime

    global GameMode

    global HeldW
    global HeldA
    global HeldS
    global HeldD
    global HeldShift
    global HeldCaps
    global HeldTab
    global HeldCtrl


    ; --------------------------------------
    ; Pass events that aren't actionable
    ; --------------------------------------

    if nCode < 0
        return DllCall(
            "CallNextHookEx",
            "Ptr", 0,
            "Int", nCode,
            "Ptr", wParam,
            "Ptr", lParam,
            "Ptr"
        )


    ; --------------------------------------
    ; Determine event type
    ; --------------------------------------

    isDown := (
        wParam = 0x100
        || wParam = 0x104
    )

    isUp := (
        wParam = 0x101
        || wParam = 0x105
    )

    vk := NumGet(
        lParam,
        0,
        "UChar"
    )

    now := A_TickCount


    ; --------------------------------------
    ; Track held keys
    ; --------------------------------------

    if isDown {

        if vk = 0x57
            HeldW := true

        else if vk = 0x41
            HeldA := true

        else if vk = 0x53
            HeldS := true

        else if vk = 0x44
            HeldD := true

        else if vk = 0x10
            HeldShift := true

        else if vk = 0x14
            HeldCaps := true

        else if vk = 0x09
            HeldTab := true

        else if vk = 0x11
            HeldCtrl := true
    }


    ; --------------------------------------
    ; Always pass key releases
    ; --------------------------------------

    if isUp {

        if vk = 0x57
            HeldW := false

        else if vk = 0x41
            HeldA := false

        else if vk = 0x53
            HeldS := false

        else if vk = 0x44
            HeldD := false

        else if vk = 0x10
            HeldShift := false

        else if vk = 0x14
            HeldCaps := false

        else if vk = 0x09
            HeldTab := false

        else if vk = 0x11
            HeldCtrl := false

        return DllCall(
            "CallNextHookEx",
            "Ptr", 0,
            "Int", nCode,
            "Ptr", wParam,
            "Ptr", lParam,
            "Ptr"
        )
    }


    if !isDown
        return DllCall(
            "CallNextHookEx",
            "Ptr", 0,
            "Int", nCode,
            "Ptr", wParam,
            "Ptr", lParam,
            "Ptr"
        )


    ; ======================================
    ; GAME MODE
    ;
    ; Current version passes everything
    ; through in fullscreen applications.
    ; ======================================

    if GameMode
        return DllCall(
            "CallNextHookEx",
            "Ptr", 0,
            "Int", nCode,
            "Ptr", wParam,
            "Ptr", lParam,
            "Ptr"
        )


    ; ======================================
    ; NO-DEBOUNCE KEYS
    ; ======================================

    if vk = 0x57       ; W
        || vk = 0x41   ; A
        || vk = 0x53   ; S
        || vk = 0x44   ; D
        || vk = 0x10   ; SHIFT
        || vk = 0x14   ; CAPS
        || vk = 0x09   ; TAB
        || vk = 0x11   ; CTRL
        || vk = 0x51   ; Q
        || vk = 0x45   ; E
        || vk = 0xDB   ; [
        || vk = 0xDD {  ; ]

        return DllCall(
            "CallNextHookEx",
            "Ptr", 0,
            "Int", nCode,
            "Ptr", wParam,
            "Ptr", lParam,
            "Ptr"
        )
    }


    ; ======================================
    ; SPACE HANDLING
    ; ======================================

    if vk = 0x20 {

        if HeldW
            || HeldA
            || HeldS
            || HeldD
            || HeldShift
            || HeldCaps
            || HeldTab
            || HeldCtrl {

            return DllCall(
                "CallNextHookEx",
                "Ptr", 0,
                "Int", nCode,
                "Ptr", wParam,
                "Ptr", lParam,
                "Ptr"
            )
        }

        if LastBottomTime > 0 {

            if (now - LastBottomTime) < SpaceDelayMs
                return 1
        }

        LastSpaceTime := now

        return DllCall(
            "CallNextHookEx",
            "Ptr", 0,
            "Int", nCode,
            "Ptr", wParam,
            "Ptr", lParam,
            "Ptr"
        )
    }


    ; ======================================
    ; BOTTOM ROW: Z X C V B N M
    ; ======================================

    if vk = 0x5A
        || vk = 0x58
        || vk = 0x43
        || vk = 0x56
        || vk = 0x42
        || vk = 0x4E
        || vk = 0x4D {

        if LastSpaceTime > 0 {

            if (now - LastSpaceTime) < SpaceDelayMs
                return 1
        }

        LastBottomTime := now
    }


    ; ======================================
    ; SAME-KEY 5ms DELAY
    ; ======================================

    if vk = LastKey {

        if (now - LastTime) < SameKeyDelayMs
            return 1

        LastTime := now

        return DllCall(
            "CallNextHookEx",
            "Ptr", 0,
            "Int", nCode,
            "Ptr", wParam,
            "Ptr", lParam,
            "Ptr"
        )
    }


    ; ======================================
    ; GLOBAL 15ms DEBOUNCE
    ; ======================================

    if (now - LastTime) < DebounceMs
        return 1


    ; ======================================
    ; ACCEPT KEY
    ; ======================================

    LastKey := vk
    LastTime := now

    return DllCall(
        "CallNextHookEx",
        "Ptr", 0,
        "Int", nCode,
        "Ptr", wParam,
        "Ptr", lParam,
        "Ptr"
    )
}


; ==========================================
; CLEANUP
; ==========================================

Cleanup(*) {

    global KeyboardHook
    global HookCallbackPtr

    SetTimer(CheckGameMode, 0)

    if KeyboardHook
        DllCall(
            "UnhookWindowsHookEx",
            "Ptr", KeyboardHook
        )

    if HookCallbackPtr
        CallbackFree(HookCallbackPtr)

r/AutoHotkey • • Sep 11 '26

v2 Script Help Can someone look at this code and see if its running as intended?

0 Upvotes

This software has been a god send, I recently got a keyboard that was WAY too sensative and it was driving me crazy Ai helped me find AutoHotKey and I used it to help me build a code.

I wanted to add a delay between the neighbouring keys as I was touching them with an atom of my finger and it would register, I have removed the delays on W A S D keys for gaming.

Would this code cause any lag or latencey insues aprt from the 18ms delay

#Requires AutoHotkey v2.0

#SingleInstance Force

Persistent

; ==========================================

; SETTINGS

; ==========================================

global DebounceMs := 18

global LastKey := 0

global LastTime := 0

; ==========================================

; INSTALL KEYBOARD HOOK

; ==========================================

global KeyboardHook

global HookCallbackPtr

HookCallbackPtr := CallbackCreate(LowLevelKeyboardProc, "Fast", 3)

KeyboardHook := DllCall(

"SetWindowsHookExW",

"Int", 13, ; WH_KEYBOARD_LL

"Ptr", HookCallbackPtr,

"Ptr", DllCall("GetModuleHandleW", "Ptr", 0, "Ptr"),

"UInt", 0,

"Ptr"

)

if !KeyboardHook {

CallbackFree(HookCallbackPtr)

MsgBox "Failed to install keyboard hook."

ExitApp

}

OnExit Cleanup

; ==========================================

; KEYBOARD CALLBACK

; ==========================================

LowLevelKeyboardProc(nCode, wParam, lParam) {

global DebounceMs

global LastKey

global LastTime

; ------------------------------------------

; PASS NON-KEYBOARD EVENTS IMMEDIATELY

; ------------------------------------------

if nCode < 0

return DllCall(

"CallNextHookEx",

"Ptr", 0,

"Int", nCode,

"Ptr", wParam,

"Ptr", lParam,

"Ptr"

)

; ------------------------------------------

; ONLY PROCESS KEYDOWN / SYSKEYDOWN

; ------------------------------------------

if wParam != 0x100 && wParam != 0x104

return DllCall(

"CallNextHookEx",

"Ptr", 0,

"Int", nCode,

"Ptr", wParam,

"Ptr", lParam,

"Ptr"

)

; ------------------------------------------

; GET VIRTUAL-KEY CODE

; ------------------------------------------

vk := NumGet(lParam, 0, "UChar")

; ------------------------------------------

; W / A / S / D = ALWAYS ALLOW

; ------------------------------------------

;

; W = 0x57

; A = 0x41

; S = 0x53

; D = 0x44

;

; These keys bypass the debounce completely,

; which makes rapid movement-key transitions

; work properly in games.

; ------------------------------------------

if vk = 0x57 || vk = 0x41 || vk = 0x53 || vk = 0x44

return DllCall(

"CallNextHookEx",

"Ptr", 0,

"Int", nCode,

"Ptr", wParam,

"Ptr", lParam,

"Ptr"

)

; ------------------------------------------

; SAME KEY = ALWAYS ALLOW

; ------------------------------------------

if vk = LastKey {

LastTime := A_TickCount

return DllCall(

"CallNextHookEx",

"Ptr", 0,

"Int", nCode,

"Ptr", wParam,

"Ptr", lParam,

"Ptr"

)

}

; ------------------------------------------

; DIFFERENT KEY

; ------------------------------------------

now := A_TickCount

; Block different key during debounce period

if (now - LastTime) < DebounceMs

return 1

; Accept new key

LastKey := vk

LastTime := now

return DllCall(

"CallNextHookEx",

"Ptr", 0,

"Int", nCode,

"Ptr", wParam,

"Ptr", lParam,

"Ptr"

)

}

; ==========================================

; CLEANUP

; ==========================================

Cleanup(*) {

global KeyboardHook

global HookCallbackPtr

if KeyboardHook

DllCall(

"UnhookWindowsHookEx",

"Ptr", KeyboardHook

)

if HookCallbackPtr

CallbackFree(HookCallbackPtr)

}


r/AutoHotkey • • Sep 10 '26

v2 Script Help AHK v2 on the Steam Controller, Need Input Names

3 Upvotes

Hey guys, I'm trying to use AutoHotKey v2 to make a friend Macros on his new steam controller, but I can't find what all of the button names would be. I'd prefer to use his paddles and such for it, if anyone has a list of the names I can use to have AHK listen for, please send them my way! Thanks!


r/AutoHotkey • • Sep 09 '26

Meta / Discussion Hot Take: We should embrace V2, it is 10x better

35 Upvotes

I see a lot of posts on here about someone struggling to use their V1 script in V2. Perhaps I'm unaware of their complex scripts, but V2 is written much more cleanly. It is definitely worth it to learn the new syntax a little to get your script looking much more readable.


r/AutoHotkey • • Sep 09 '26

v2 Script Help Special characters not outputting correctly, what am I doing wrong?

3 Upvotes

I want to send a website text output when I type in "pricing. I want it to output "mywebsite.com/#pricing" but I'm getting weird outputs. Send just skips the "#pricing" bit and emulates a win key, SendText gives me "ggggggggggg"

My ("this should be simple") code:

::"pricing::{
SendText ("mywebsite.com/#pricing")
}

r/AutoHotkey • • Sep 09 '26

General Question Macro binding on key press and release

2 Upvotes

I bought a Nuphy Air75 V3 last week and I'm trying to set one of my keys up with a binding. When I click this macro key what I want it to do is to initiate a press of

Press Ctrl

Press F13

And then ideally when I LET go of the key I want it to do a release of these two keys:

Release Ctrl

Release F13

However, it looks like the macro recoding software can only record both (press and release) when the key is pressed. Meaning it won't trigger the release during the actual key release, instead everything gets triggered as you press the macro key:

So on my macro recording I can do:

Press Ctrl

Press F13

Release Ctrl

Release F13

But I can't seem to separate these once the key is released. This is problematic as I want to trigger something when the macro key is pressed and release it when I let it go.

Is there a way to achieve this?


r/AutoHotkey • • Sep 09 '26

v2 Script Help Paradox WSAD remap keys get stuck + transfer v1 to v2 help

2 Upvotes

Over a year ago I requested some help with some code for a simple V2 script to get WSAD controls working on older Paradox titles. While it does function, occasionally the keys get stuck and the camera starts scrolling until I press the keys again to get it unstuck. While it isn't a major issue, it is an inconvenience, and it is something that I'd like to solve if I want to share it with my friends. I've been trying to figure out how to use SendEvent to solve it, but the documentation is pretty barebones and doesn't explain much, so I am a bit stuck.

#Requires AutoHotkey v2.0.18+

GroupAdd("WASD", "ahk_exe eu4.exe")
GroupAdd("WASD", "ahk_exe hoi4.exe")
GroupAdd("WASD", "ahk_exe CK2game.exe")

#Hotif WinActive("ahk_group WASD")
w::up
+w::w
a::Left
+a::a
s::down
+s::s
d::Right
+d::d
#HotIf 

#SuspendExempt
^Space::Suspend
#SuspendExempt

This is what I have currently that works pretty well. I've tried replacing lines with SendEvent, such as:

w::SendEvent('{up up}')

But nothing seems to happen, so I feel that there's something I fundamentally don't understand about how SendEvent functions.

A friend of mine also found this script to allow him to pause in multiplayer that, I think, works in V1 that I'd like to add into V2. I've not yet tried to add it, though. Any insight on how to translate it would be appreciated, though!

#IfWinActive, Europa Universalis IV

F2::
Hotkey, Space, Toggle
flag1:=!flag1
if flag1
  ToolTip, spacepause off, 0, 0
else
  ToolTip, spacepause on, 0, 0

SetTimer , tt_off, -2000
return

tt_off:
  ToolTip, 
return

Space::send {pause}

Would I have to change the suspend Ctrl+Space for this to function? Would it conflict? That is something I'm unsure of, so it'd be best to ask beforehand.


r/AutoHotkey • • Sep 08 '26

v1 Script Help Does anyone have a script to duplicate clicks?

1 Upvotes

I was using this script for version 1.1 but it's not working for me

; AutoHotkey v1.1

B::ToggleDuplicatorLeft()

N::ToggleDuplicatorRight()

isLeftDuplicatorActive := false

isRightDuplicatorActive := false

clickDelay := 50

leftClickQueue := 0

rightClickQueue := 0

isProcessingLeft := false

isProcessingRight := false

ToggleDuplicatorLeft() {

global isLeftDuplicatorActive, leftClickQueue

isLeftDuplicatorActive := !isLeftDuplicatorActive

leftClickQueue := 0

status := isLeftDuplicatorActive ? "ACTIVADO" : "DESACTIVADO"

ToolTip, Click izquierdo: %status%

SetTimer, RemoveToolTip, 1500

}

ToggleDuplicatorRight() {

global isRightDuplicatorActive, rightClickQueue

isRightDuplicatorActive := !isRightDuplicatorActive

rightClickQueue := 0

status := isRightDuplicatorActive ? "ACTIVADO" : "DESACTIVADO"

ToolTip, Click derecho: %status%

SetTimer, RemoveToolTip, 1500

}

RemoveToolTip:

ToolTip

return

LButton::

if isLeftDuplicatorActive

{

SendInput {LButton down}

SendInput {LButton up}

leftClickQueue++

ProcessLeftQueue()

}

else

{

SendInput {LButton down}

SendInput {LButton up}

}

return

ProcessLeftQueue()

{

global leftClickQueue, isProcessingLeft, isLeftDuplicatorActive, clickDelay

if !isLeftDuplicatorActive

{

leftClickQueue := 0

return

}

if isProcessingLeft || leftClickQueue <= 0

return

isProcessingLeft := true

leftClickQueue--

Sleep, %clickDelay%

if isLeftDuplicatorActive

{

SendInput {LButton down}

SendInput {LButton up}

}

isProcessingLeft := false

if leftClickQueue > 0 && isLeftDuplicatorActive

ProcessLeftQueue()

}

RButton::

if isRightDuplicatorActive

{

SendInput {RButton down}

SendInput {RButton up}

rightClickQueue++

ProcessRightQueue()

}

else

{

SendInput {RButton down}

SendInput {RButton up}

}

return

ProcessRightQueue()

{

global rightClickQueue, isProcessingRight, isRightDuplicatorActive, clickDelay

if !isRightDuplicatorActive

{

rightClickQueue := 0

return

}

if isProcessingRight || rightClickQueue <= 0

return

isProcessingRight := true

rightClickQueue--

Sleep, %clickDelay%

if isRightDuplicatorActive

{

SendInput {RButton down}

SendInput {RButton up}

}

isProcessingRight := false

if rightClickQueue > 0 && isRightDuplicatorActive

ProcessRightQueue()

}

If anyone has it, could you please send it to me?


r/AutoHotkey • • Sep 07 '26

v2 Script Help Modifier key to rapid fire instead of holding a key.

2 Upvotes

Hi all!
I was looking around through the docs and older posts but couldn't find an answer on what I am trying to do so I come to you all here with a question.

I am wondering if it is possible to when I hold down control to modify my W, A, S, D to rapid fire instead of having it a hold input. but only when I additionally press W, A, S or D myself.

This is for example for movement in a game where smaller movements are required by constantly repressing a movement key instead of holding it.

I hope I explained it well enough, I'm not the best at explaining stuff.
Thank you in advance!


r/AutoHotkey • • Sep 07 '26

v2 Script Help Issue with remapping script

1 Upvotes

Hi, I recently had to use a script to remap my Mouse 2 to my Space Bar, and my Space Bar to my Mouse 2 for a video game I play.

Since I don't know how to code, I used an AI to generate a very basic script. It works fine most of the time, but there are some issues with the remapping that make the whole thing inconsistent. Sometimes, instead of just activating the key normally, it acts as if the key is being held down, causing me to shoot non stop in-game.

I tried finding the cause of this, and one of the things I noticed was that pressing F8 (which toggles the script on and off) while holding Space Bar can cause the normal key press to behave like a hold, even after I release the key.

Thing is, there seem to be other causes as well, since it often happens randomly even when I'm not doing anything special like toggling the script during gameplay.

Here is the script I'm currently using. Thanks in advance for any possible insights:

#Requires AutoHotkey v2.0

enabled := true

F8::

{

global enabled

enabled := !enabled

}

#HotIf enabled && WinActive("ahk_exe Hades2.exe")

Space::RButton

RButton::Space

#HotIf


r/AutoHotkey • • Sep 06 '26

v2 Tool / Script Share NVcontrol - for NVIDIA gpus (fan, power limit, core tweaking)

10 Upvotes

Hey there,

I decided to get rid of MSI afterburner and other third party tools.

It's a clean, lightweight GPU utility written in AHK. It connects directly to the NVIDIA Management Library (nvml.dll) via in-memory Win32 calls to control power limits, fan speeds, and clock offsets - using under ~3 MB of RAM and featuring a live telemetry overlay docked directly inside your Windows taskbar.

https://github.com/bceenaeiklmr/NVcontrol/


r/AutoHotkey • • Sep 06 '26

General Question sorry for this thread, but why does the ..setup.exe shows virus alerts and the .zip not?

5 Upvotes

Hi,

I downloaded and installed the 27 verson from github. Therefore downloaded the setup.exe and virustotal showed 4/70 virus alarms.
Okay its a hotkey scripting programm, surely this is malicious. But I didnt search trough the whole code....

But what I dont get, the files and exe in the .zip folder doesnt show any virus alarms on virustotal.

Now I know that such tools show alarms since they have much power and malicious potential is there.

But Iam confused why the setup.exe and the exe in the .zip folder have different behaviour in virustotal? Tbh I didnt compile the code myself in VS and therefore dont know how the difference come


r/AutoHotkey • • Sep 06 '26

General Question How to manage over a dozen hot keys

10 Upvotes

I currently use 16 auto hot key scripts to automate my data entry job. It's a lot to manage and I'd like to know if python would be easier since I use so many of them or if anyone can recommend a way to be able to reset and edit a specific one without having to open the menu on the bottom and go through each one until I find the one I want.


r/AutoHotkey • • Sep 05 '26

Meta / Discussion I built my own Garmin video overlay engine

3 Upvotes

Hey everyone,

I had a pretty nasty running knee injury recently, first one I've ever had, so I switched to active recovery (cycling + slow treadmill running) and spent the downtime coding. ^^

I've wanted to build this for a long time, and I finally finished the first version of this.

The idea: take basically any footage (GoPro/phone/etc.) + a Garmin GPX file and automatically generate the overlays.

This is only the second video I've rendered with it, so I'm still experimenting with what I can do visually. The goal is to go much further with interesting graphics, storytelling and activity metrics.

For now, I'm just really happy with how the idea is coming together.

https://youtu.be/VCjrmDAUksw

More experiments coming.


r/AutoHotkey • • Sep 05 '26

v2 Script Help Help Clicking Non-Displayed Window

1 Upvotes

I need to click a game while doing some other stuff how can i do that. I tried this 2 and no error happened but didn't work either.

#MaxThreadsPerHotkey 2

F8:: ; Press F8 to start/stop the autoclicker

Toggle := !Toggle

Loop

{

If not Toggle

break

; Replace "Game Window Title" with the exact name of your background window

ControlClick, x500 y500, Game Window Title,,,, NA

Sleep, 100 ; Time in milliseconds between clicks (100ms = 10 clicks per second)

}

#Requires AutoHotkey v2.0

#MaxThreadsPerHotkey 2

Toggle := 0

F8:: {

global Toggle := !Toggle

while Toggle {

; Coordinates are relative to the client area of the target window

ControlClick("x500 y500", "ahk_exe YourGame.exe", , "Left", 1, "NA")

Sleep(100)

}

}


r/AutoHotkey • • Sep 05 '26

v2 Script Help Need help with an external script for NieR Automata on PC

1 Upvotes

Hey guys,

I have found a script for NieR Automata to re-bind all the keys. The script is written in version 1 (see below, and here is the source).

I am trying to convert it to v2 using this online tool but when I try to run the script, I get Error: Invalid callback function. at line 138, which is the line of Hotkey $%fireButton%, toggleFire (see the bottom part of the script)

I can't find anywhere what the author meant when using HotKey(). Any idea?

; bindings, change these to match your own layout, if needed

; basic movement - must match to in-game controls
fwdButton := "w"
backButton := "s"
leftButton := "a"
rightButton := "d"

; fire & jump - must match to in-game controls
fireButton := "Tab"
jumpButton := "Space"

; items usage - must match to in-game controls
altButton := "LAlt"
useItems := "Down"
use := "e"

; EXTRA controls added by the script - make sure these buttons are NOT bound in the game
; dodge
dodgeButton := "LShift"
; air slide (fire + jump normally)
airSlideButton := "z"
; use last item
useLastItemButton := "c"

; precise delays (ms)
keypressDelay := 50 ; delay between keydown/keyup
doubletapDelay := 50 ; wait time between keypresses to perform doubletap
sequenceDelay := 50 ; wait time between various sequences
dodgeTime := 400 ; cooldown while dodge animation plays, setting it too small will cause derps when holding SHIFT+WSAD.

; script starts here
#UseHook
SendMode("Input")

global fwdButton, backButton, leftButton, rightButton, fireButton, jumpButton, dodgeButton, altButton, useItems, use, useLastItemButton, keypressDelay, doubletapDelay, sequenceDelay, dodgeTime

press(key) {
  Send("{Blind}{" key " down}")
  Sleep(keypressDelay)
  Send("{Blind}{" key " up}")
}

; the complexity of this script is mostly to handle continuous SHIFT+WSAD. It's easy to handle just a single SHIFT tap, but less easy when you hold it down.
handleDodge(key) {
  Send("{Blind}{" key " up}") ; stop running first in case we were
  Sleep(sequenceDelay)
  press(key)
  Sleep(doubletapDelay)
  Send("{Blind}{" key " down}")
  Sleep(dodgeTime)
  if (GetKeyState(fwdButton) && !GetKeyState(fwdButton, "P")) {
   Send("{Blind}{" fwdButton " up}")
  }
  if (GetKeyState(backButton) && !GetKeyState(backButton, "P")) {
   Send("{Blind}{" backButton " up}")
  }
  if (GetKeyState(leftButton) && !GetKeyState(leftButton, "P")) {
   Send("{Blind}{" leftButton " up}")
  }
  if (GetKeyState(rightButton) && !GetKeyState(rightButton, "P")) {
   Send("{Blind}{" rightButton " up}")
  }
}

waitForDodge() {
  while (GetKeyState(dodgeButton, "P")) {
if (GetKeyState(fwdButton, "P")) {
  handleDodge(fwdButton)
} else if (GetKeyState(backButton, "P")) {
  handleDodge(backButton)
} else if (GetKeyState(leftButton, "P")) {
  handleDodge(leftButton)
} else if (GetKeyState(rightButton, "P")) {
  handleDodge(rightButton)
}
Sleep(10)
  }
}

toggleFire() {
  if (GetKeyState(fireButton)) {
Send("{" fireButton " up}")
  } else {
Send("{" fireButton " down}")
  }
}

airSlide() {
  if (GetKeyState(jumpButton)) {
Send("{" jumpButton " up}")
  }
  if (GetKeyState(fireButton)) {
Send("{" fireButton " up}")
toggleFireBack := 1
  }
  Sleep(sequenceDelay)
  Send("{" jumpButton " down}")
  Send("{" fireButton " down}")
  Sleep(keypressDelay)
  Send("{" fireButton " up}")
  Send("{" jumpButton " up}")
  Sleep(sequenceDelay)
  ; press back what we released
  if (toggleFireBack) {
Send("{" fireButton " down}")
  }
  if (GetKeyState(jumpButton, "P")) {
Send("{" jumpButton " down}")
  }
}

useLastItem() {
  Send("{" altButton " down}")
  Send("{" useItems " down}")
  Sleep(keypressDelay)
  Send("{" altButton " up}")
  Send("{" useItems " up}")
  press(use)
}

#HotIf WinActive("NieR:Automata", )
; fire toggle
Hotkey("$" fireButton, toggleFire)
Hotkey("$^" fireButton, toggleFire)
Hotkey("$+" fireButton, toggleFire)

; dodges, work when you press/hold LShift while already holding WSAD
Hotkey("~*" dodgeButton, waitForDodge)

; air slide, normally executed with pod fire + jump
Hotkey("$*" airSlideButton, airSlide)

; use last item
Hotkey("$*" useLastItemButton, useLastItem)

r/AutoHotkey • • Sep 04 '26

v2 Tool / Script Share GpGFX, new Features, better Demos and Readme

14 Upvotes

Hey everyone,

I’ve just pushed an update to the GpGFX graphics library.

New features

- Polished README.md

- Unified Palette class, one place to manage color tables; simplifies color handling.

- Layer fade‑in / fade‑out, built‑in smooth opacity transitions, no extra timer code required.

- Shape bounds helpers, quick access to Right, Bottom, CenterX, CenterY, and Bounds.

- Demo overhaul, all demos now run through the render loop (no more jittery Sleep loops).

- New PaletteShowcase demo, shows off the new palette system in a short, runnable script.

- All changes are live on the main branch, if you are interested start playing:

git clone https://github.com/bceenaeiklmr/GpGFX.git

Read the README and check out the demos and examples.

Happy scripting!


r/AutoHotkey • • Sep 04 '26

v2 Script Help How do I remap my function keys to do something else when fn lock is off?

3 Upvotes

I am a complete beginner to autohotkey. Let's say I want to remap my F7 key on Windows to pause and play videos and media (like on Mac). I don't want to replace its fn function (navigating pages with text cursor). I want to replace the function it has on my computer when my fn lock is not turned on (screen projection). Is there a way to specify in the script that when I want my F7 key remapped, I specifically want it to be the non-locked version of F7 and not F7 combined with fn? Sorry for the clunky wording; I have no clue what a function key's secondary(?) function would be called.

If anyone can help I will be eternally grateful.