Jump to content
LaunchBox Community Forums

DEmul: I'd like to add an exit command to this bat file. (CRTGeomMOD Bezels)


Recommended Posts

Posted

LB is set to read the bat file, but iit won't respond to the universal escape command I set for the emulator, I wind up having to hit Alt+F4 to exit. Would like to change that!

So far my bat file says this:

cd /d "%~dp0"

IF NOT "%~1"=="" set rom=%~n1

DEL .\reshade-shaders\Textures\bezel.png

copy .\Artwork\naomi\mvsc2u.png .\reshade-shaders\Textures\bezel.png

START nomousy.exe /hide
START /wait Demul07_CRTGeomMOD.exe -run=naomi -rom=mvsc2u
START nomousy.exe

EXIT

I would like to add a line of code that enables me to assign the close/exit command Alt+F4 close to the Esc button.

Posted
5 hours ago, Bucky said:

I would like to add a line of code that enables me to assign the close/exit command Alt+F4 close to the Esc button.

Batch files cannot detect key presses.  But AutoHotkey scripts can.

It might look something like this:

SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#SingleInstance Force

rom = %1%
FileDelete, .\reshade-shaders\Textures\bezel.png
FileCopy,.\Artwork\naomi\%rom%.png, .\reshade-shaders\Textures\bezel.png

Run, nomousy.exe /hide
RunWait, Demul07_CRTGeomMOD.exe -run=naomi -rom=%1%
Run, nomousy.exe
ExitApp

$Esc::
{
  Send !{F4}
}

Save the file as fileName.ahk

This was created 'quick-and-dirty' and has not been tested.

  • Thanks 1
Posted

Yeah, this worked like a beauty! Good shit. Many Thanks!

 

I forgot to ask I'm skimming old posts and it had me wondering... I saw another thread after posting this one indicating Alt+F4 is the same as pushing "End Process". In other words, a violent intrusive way of shutting down the emulator. I thought it was more akin to pushing "X" at the top of the window or File>Exit but then again what do I know

 

Is it true that process is the brutal shutdown method? If so, I'd ask for a script that mimics pushing the X button at the top right of the window or File>Exits

Something tells me that this isn't the case and I could be overthinking it. Please, let me know if this is a normal exit procedure if it is, this issue can be put to bed. Once again, I appreciate the fix! 

  • Like 1
Posted
53 minutes ago, Bucky said:

I saw another thread after posting this one indicating Alt+F4 is the same as pushing "End Process". In other words, a violent intrusive way of shutting down the emulator. I thought it was more akin to pushing "X" at the top of the window or File>Exit 

Alt+F4, File>Exit and clicking the X in the upper right corner all close the app the same [nice] way.

In AHK, Process, Close, program.exe is the brute force method for closing an app. Same as clicking End Process in Task Manager.  There are a few rare cases though that this is necessary.  joytokey.exe is one of them.

 

58 minutes ago, Bucky said:

Yeah, this worked like a beauty! Good stuff. Many Thanks!

Glad it worked and glad I could help.

  • Thanks 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...