AutoHotkey is a free, open-source scripting language to automate processes in Windows.
AutoHotkey's focus is on keyboard shortcuts, hotkeys and macros.
Babycastles uses AutoHotkey to turn computers into arcade machines, by doing things like:
- Hiding the system cursor
- Hiding the taskbar
- Running a game
- Running JoyToKey
- Mapping all of these things to the middle mouse button
By adding an AutoHotkey script to the Windows Startup folder, the AutoHotkey script can run when the computer turns on.
- Click Clone or download on this repo and choose Download ZIP
- Unzip the contents by right-clicking the downloaded zip and selecting Extract All...
- Move the contents of the unzipped folder into the folder of your game
- Modify runner.ahk to fit your particular needs (see the Building your script section)
- Press the Windows logo key + R, type
shell:startup
, then select OK. The startup folder opens. - Create a shortcut to runner.ahk in the startup folder
- Right-click and hold runner.ahk
- While still holding the right-click, drag the file into the startup folder
- Release the right-click and select Create shortcuts here
- Open runner.ahk in a text editor (Right-click and Open With Notepad++ or Notepad)
For most use cases, you can just modify the Refresh
method to run your game.
- Replace MyGame.exe in
Run "MyGame.exe"
with the name of your game file
Running this script will:
- Close and quit all open programs and folders
- Hide the system cursor
- Hide the taskbar
- Run the specified game/executable
- Maps the Middle Mouse button to do all of the above steps
- Enable the hotkeys specified in utils/hotkeys.ahk - see the Hotkeys section
The utils/hotkeys.ahk file is where we define hotkeys/shortcuts to perform certain tasks.
Defaults are:
- Windows logo key + A
- Reloads the AutoHotKey script
- Windows logo key + T
- Toggles the taskbar
- Windows logo key + C
- Toggles the cursor
- Windows logo key + Z
- Quits AutoHotKey script and runs the ExitFunction
- Explain each of the util scripts in detail (and batch file)
- Define command vs function
- Explain run command - https://www.autohotkey.com/docs/commands/Run.htm
- Explain process command - can be used to close a target process (by PID or name) - https://www.autohotkey.com/docs/commands/Process.htm
omit a parameter by adding a comma
Explain options for run
Options
Max: launch maximized
Min: launch minimized
Hide: launch hidden (cannot be used in combination with either of the above)
Explain ExitApp
Explain ORDERING - https://www.autohotkey.com/docs/Scripts.htm The Top of the Script (the Auto-execute Section)
After the script has been loaded, it begins executing at the top line, continuing until a Return, Exit, hotkey/hotstring label, or the physical end of the script is encountered (whichever comes first). This top portion of the script is referred to as the auto-execute section.