About This File
The Panic Button is a script designed for arcade and emulation users running Windows. If an emulator crashes or unwanted processes appear, it allows you to restore the Windows session to exactly how it was when the system first booted, without needing to use the keyboard. This script is especially useful for users controlling their system via a game controller and using tools like JoyToKey to map keyboard shortcuts to controller buttons.
How the Panic Button Works
-
Initializing the session:
- Users start their Windows session and launch all the necessary tools (emulators, frontends, etc.).
- Once everything is ready, they run getProcessList.exe or getProcessList.ahk. This generates a processes_start.txt file that lists all the active processes at the time of session startup.
-
Activating the Panic Button:
- If an emulator crashes or unwanted processes start running, the user can simply press Ctrl+Alt+P (or a shortcut linked to their controller via JoyToKey) to activate the panic button.
- The panicButton.ahk script compares the current list of processes with the one recorded in processes_start.txt and closes all processes that weren’t present at the session’s start.
-
Restarting Key Applications:
-
After cleaning up the session, the script will restart key applications such as:
- JoyToKey with the desired profile.
- BigBox (or any other arcade frontend).
-
After cleaning up the session, the script will restart key applications such as:
Launching the Panic Button at Windows Startup
If you want the Panic Button to launch automatically when Windows starts, follow these steps:
-
Create a panicButton.bat file to run the panicButton.ahk script.
-
Add a shortcut to this panicButton.bat file in the Windows Startup folder. This folder is typically located at:
C:\Users\<YourName>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
-
Make sure to modify this line in the panicButton.bat file to match the path to your script:
set script_path="D:\HFSBox\Utilities\PanicButton\panicButton.ahk"
Customizing the Script
To make this system work with your setup, you need to adjust two lines in the panicButton.ahk script:
-
Modify this line to match the path to your JoyToKey configuration:
Run, D:\HFSBox\Utilities\JoyToKey\JoyToKey.exe "Layout 8 boutons.cfg"
-
Modify this line to match the path to your BigBox application (or other frontend):
Run, D:\LaunchBox\BigBox.exe
Conclusion
The Panic Button simplifies process management after a crash by resetting the session without the need for a keyboard, making it ideal for arcade and emulation users controlling their system via a game controller. It automatically restores essential tools and relaunches BigBox, ensuring a smooth user experience.