Skip to content

Instantly share code, notes, and snippets.

@seth10
Last active March 20, 2022 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seth10/d0e1894b818051079de816d266de8590 to your computer and use it in GitHub Desktop.
Save seth10/d0e1894b818051079de816d266de8590 to your computer and use it in GitHub Desktop.
AHK script to resize the StepMania window to not waste any vertical space
; Make repeated hotkey uses work, each time closing and re-launching StepMania, and only re-showing the task bar when the game is manually closed (instead of using the hotkey to relaunch it).
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance force ; automatically replace old instance of script when launched again
#MaxThreadsPerHotkey 999 ; allows multiple instances of the hotkey subroutine to run, each temporarily halting the previous
WinTitle := "Simply Love"
SetTitleMatchMode, 3
^+s:: ; Ctrl+Shift+S
WinClose %WinTitle%
WinWaitClose %WinTitle%
WinHide, ahk_class Shell_TrayWnd ; hide taskbar
Run, C:\Games\StepMania 5\Program\StepMania.exe
WinWait, %WinTitle%
WinActivate, %WinTitle%
WinSet, Style, -0xC40000, %WinTitle% ; remove titlebar
WinMove, %WinTitle%, , 0, 0, 1420, 1080 ; TV is partially cracked, so we can't go 1920px wide
WinWaitClose %WinTitle% ; if the hotkey is pressed again while this is waiting, this subroutine will pause. Eventually, when the most recent thread finishes by closing the window instead of pressing the hotkey again, each subroutine will show the taskbar and exit, allowing the next one to run.
WinShow, ahk_class Shell_TrayWnd ; show taskbar
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment