Update: I can get the AHK script feature to work for the Retroarch Emulator. It will launch the default.bat file, and restore me to keyboard mode. So, that saves me from needing to find a way to have that .bat run on exiting of steam games. Still not sure why that AHK feature won't work for me running windows/steam games, but so be it.
Now on to next issue with this setup. I have the UCR launch with this bat when I first start windows, and run in background. Problem is, first time I launch a steam game through BigBox, it runs the bat and ends up re-launching UCR from scratch. This only happens the first time. Every subsequent time the .bat switches profiles without relaunching UCR. Relaunching is an issue because by the time it finishes loading, the game has loaded, and the game loses focus to the newly relaunched UCR.
I think it has something to do with the CLI.AHK that is used by UCR.
Code:
/*
UCR Command line tool
The recommended editor for UCR is AHK Studio
https://autohotkey.com/boards/viewtopic.php?t=300
*/
; GUID used to control remote instance of UCR
UCRguid := "{E97F3D9C-47D5-47EA-92FB-2974647DB131}"
; Get an existing running instance of UCR
try remoteUCR := ComObjActive(UCRguid)
try parentProfileName = %1% ; First passed parameters defines a root profile name, this can alternatively be a GUID
try childProfileName = %2% ; The second parameter is the name of a child profile under the system profile
if remoteUCR
{
; Change profile if script is already running
remoteUCR.ChangeProfileByName(parentProfileName, childProfileName, 0)
} else {
Run UCR.exe UCR.ahk "%parentProfileName%" "%childProfileName%"
}
ExitApp
I don't know code, but it seems to have something in there that detects if ucr is running or not.
so, if I launch UCR myself, first time I run this through BigBox it doesn't realize that UCR is already running. But, after BigBox (re)launches it for me, NOW it will recognize that it is running and just execute the profile switch without a full reload.
Thoughts on how to handle?
FWIW, this is why I started playing around with the .bat files in the first place - I figured if UCR launched through a .bat on windows startup, and then BigBox launched the same .bat to execute the profile switch, that somehow it would recognize that the UCR was already loaded and not try to reload. That didn't work.