Skip to content

Instantly share code, notes, and snippets.

@5j9
Created January 25, 2026 19:50
Show Gist options
  • Select an option

  • Save 5j9/10c107f728c6d30a08528c5979141fb0 to your computer and use it in GitHub Desktop.

Select an option

Save 5j9/10c107f728c6d30a08528c5979141fb0 to your computer and use it in GitHub Desktop.
AutoHotkey v2 script for Fusion.exe: Emulates "Sticky Keys" for navigation (ASDQWE/Arrows) to maintain input states during paused frame-advance workflows. Includes a CapsLock toggle and status indicator.
/*
================================================================================
FUSION 3D FRAME-ADVANCE INPUT BUFFER
================================================================================
USAGE:
1. Press [Pause] to halt the simulation/emulation in Fusion.
2. Toggle [A,S,D,Q,W,E,Arrows] to set the desired movement/action state.
3. Use the [Insert] key to advance frame-by-frame.
(The keys will remain "digitally held" thanks to this script).
4. Toggle [CapsLock] to instantly release all keys and disable sticky mode.
NOTE: This script intercepts 'Key Up' events to keep buttons logically pressed.
================================================================================
*/
#Requires AutoHotkey v2.0
#SingleInstance Force
global ActiveKeys := Map()
global StickyModeEnabled := True ; Starts enabled by default
; --- CapsLock Toggle (Works even if Fusion isn't focused) ---
~CapsLock:: {
global StickyModeEnabled := !StickyModeEnabled
; If we just disabled the mode, release all stuck keys
if !StickyModeEnabled {
ReleaseAllKeys()
}
; Update visual feedback immediately
UpdateTooltip()
}
#HotIf WinActive("ahk_exe Fusion.exe") and StickyModeEnabled
; Navigation and Action Keys
*a:: ToggleKey("a")
*a Up:: {
}
*s:: ToggleKey("s")
*s Up:: {
}
*d:: ToggleKey("d")
*d Up:: {
}
*q:: ToggleKey("q")
*q Up:: {
}
*w:: ToggleKey("w")
*w Up:: {
}
*e:: ToggleKey("e")
*e Up:: {
}
; Arrow Keys
*Left:: ToggleKey("Left")
*Left Up:: {
}
*Right:: ToggleKey("Right")
*Right Up:: {
}
*Up:: ToggleKey("Up")
*Up Up:: {
}
*Down:: ToggleKey("Down")
*Down Up:: {
}
#HotIf
; --- Functions ---
ToggleKey(keyName) {
if GetKeyState(keyName) {
Send("{" keyName " up}")
if ActiveKeys.Has(keyName)
ActiveKeys.Delete(keyName)
} else {
Send("{" keyName " down}")
ActiveKeys[keyName] := True
}
UpdateTooltip()
}
ReleaseAllKeys() {
for key, val in ActiveKeys {
Send("{" key " up}")
}
ActiveKeys.Clear()
}
UpdateTooltip() {
; CoordMode "ToolTip", "Screen"
if !StickyModeEnabled {
; Show a brief message that mode is OFF, then hide after 1 second
ToolTip("Sticky Mode: DISABLED", 0, 0)
SetTimer () => ToolTip(), -1000
return
}
if (ActiveKeys.Count == 0) {
ToolTip()
return
}
displayStr := "Sticky Active: "
for key, val in ActiveKeys {
displayStr .= "[" . StrUpper(key) . "] "
}
ToolTip(displayStr, 0, 0)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment