Aevans0001 Posted July 28, 2019 Share Posted July 28, 2019 (edited) So first I got my first commodore 64 game working using Joytokey and additional apps. I put a startup app to load joytokey, and then a batch file to kill joytokey after closing emulator. That worked, however it only worked for the one game. I need 20,000 C64 games to work. So I tried an autohotkey script. So I got the autohotkey to load jpytpkeu amd an exit script to run the bat file. However, it didn't run the batch file. So then I tried using the following cod e to kill it. if WinExist("JoyToKey Ver6.1.1 : Joytokey") WinClose ; use the window found above this again failed to load upon exit of the emulator. I have verified both ways worked independently, but not through Launchbox. ------------------------------Edit-------------------------- Ok so I got it working, however I would lke to see how to do it the proper way with ahk script in begging and end. Here is the code I used Run, d:\games\joytokey\joytokey.exe WinWait, ahk_exe x64.exe WinWaitClose ; Wait for the exact window found by WinWait to be closed. Run, "d:\games\joytokey\joytokeykill.bat" and here is my version of joytokeykill.bat taskkill /IM joytokey.exe /F This is specifically for Winvice but you can use it with any emulator, you just change the ahk_exe section Edited July 28, 2019 by Aevans0001 Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted August 1, 2019 Share Posted August 1, 2019 There isn't currently a way to setup an emulator with a 'run before main application' and 'run after main main application ' like you can per game. However under "Edit Emulator" you can add your script under the "Running AutoHotKey Script" tab. Also, you could add your bat file command to the script instead of calling it. Run, d:\games\joytokey\joytokey.exe WinWait, ahk_exe x64.exe WinWaitClose ; Wait for the exact window found by WinWait to be closed. Run taskill.exe /IM joytokey.exe /F,, Hide Quote Link to comment Share on other sites More sharing options...
d8thstar Posted June 7, 2021 Share Posted June 7, 2021 sorry to bring up an old post but this is exactly what i am trying. my bat file will kill joytokey by rom. but the above won't kill joytokey when exiting the emu Quote Link to comment Share on other sites More sharing options...
Your Friendly A.I Overlord Posted June 8, 2021 Share Posted June 8, 2021 (edited) 9 hours ago, d8thstar said: my bat file will kill joytokey by rom. but the above won't kill joytokey when exiting the emu You must run the bat file while exiting the emulator. Copy/paste to the "Running AutoHotKey Script" tab and change the path to your bat file: $Esc:: { Run, D:\Emulators\CloseJoyToKey.bat WinClose, ahk_exe {{{StartupEXE}}} } Or close JoyToKey directly: $Esc:: { Process, Close, JoyToKey.exe WinClose, ahk_exe {{{StartupEXE}}} } *Edit* If you would close an emulator with Escape natively (without an exit script), you could also try: $Esc:: { Process, Close, JoyToKey.exe Send, {Esc down} Sleep, 150 Send, {Esc up} } Edited June 8, 2021 by Koroth Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.