Jump to content
LaunchBox Community Forums

Issue with Pause Menu Exit Button vs. ESC Key for JoyToKey Profile Change


Crabi
Go to solution Solved by JoeViking245,

Recommended Posts

Hi everyone,

I'm facing an issue with the Pause Menu's Exit button not behaving the same as when I press the ESC key. I've set up a JoyToKey profile change that works perfectly when I hit the ESC key, but it doesn't trigger when I select "Exit" from the Pause Menu.

Here’s the script I’ve added under the "Execution Script":

 
; This section closes PCSX2 when pressing Escape
DetectHiddenWindows On
if WinExist("JoyToKey")
    Process, Close, joytokey.exe
Sleep, 1000
Run, "D:\HFSBox\Utilities\JoyToKey\JoyToKey.exe" "Playstation.cfg"
DetectHiddenWindows Off

$Esc::
{
    WinClose, ahk_exe {{{StartupEXE}}}
    if WinExist("JoyToKey")
        Process, Close, joytokey.exe
    Run, "D:\HFSBox\Utilities\JoyToKey\JoyToKey.exe" "Layout 8 Boutons.cfg"
}

 

The profile change works as expected when I press ESC, closing JoyToKey and launching the appropriate profile. However, when I use the Exit button in the Pause Menu, this behavior doesn’t happen.

Has anyone encountered this issue or have any suggestions to make the Pause Menu Exit button behave like the ESC key?

Thanks in advance!

Link to comment
Share on other sites

  • Solution
44 minutes ago, Crabi said:

I'm facing an issue with the Pause Menu's Exit button not behaving the same as when I press the ESC key.

The script you show is in the Running Script section of the emulator. (An educated guess)

To exit from the Pause Menu, that portion of the script [also] goes in the Exit Script section - 'The script to use when exiting from the Pause Menu'.

So in the emulators Exit Script section, put:

$Esc::
{
    if WinExist("JoyToKey")
        Process, Close, joytokey.exe
    Run, "D:\HFSBox\Utilities\JoyToKey\JoyToKey.exe" "Layout 8 Boutons.cfg"
    WinClose, ahk_exe {{{StartupEXE}}}
}

(while keeping the full script in the Running Script section.)

 

Note: I moved the 'close the emulator' to the last line.  I'm kind of surprise that when exiting from NOT in the pause menu that the script changes the profile back.

I say this because when the game is exited, the Running Script is essentially discarded/thrown-away/process-killed.  No matter where it's at.  It may be that the processes you have, take place "super-fast".  i.e. before the game is 'completely exited'.  That said, if it ain't broke, don't fix it. ;) 

Link to comment
Share on other sites

Thank you very much, it was that :)

Here the script in the exit menu :

; PCSX2 has an ugly exit process; this cleans it up visually
DetectHiddenWindows On
;if WinExist("JoyToKey")
	Process, Close , JoyToKey.exe
Sleep, 1000
Run, "D:\HFSBox\Utilities\JoyToKey\JoyToKey.exe" "Layout 8 Boutons.cfg"
DetectHiddenWindows Off
WinClose, ahk_exe {{{StartupEXE}}}

 

  • Game On 1
Link to comment
Share on other sites

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...