Jump to content
LaunchBox Community Forums

Recommended Posts

Posted

I'VE GOOGLED THIS QUESTION AND SEARCHED THE FORUMS I PROMISE

Hello again,

I'm having an issue with Cemu not closing correctly. Hitting the close application button only brings Cemu out of fullscreen, a second press does nothing. I had to enable mouse control in Big Box in order to close the window itself once it comes out of fullscreen. What's strange is that if I close Cemu by hitting my escape key, and then hitting my close application button, then Cemu closes out.

 

My current Running AHK script looks like this:

$Esc::
{
   WinClose, ahk_exe {{{StartupEXE}}}
}

I've tried the other options found in various posts for trying to get LB/BB to close with one ESC key, but ultimately I want it to just close from the push of my controller button. Can anyone help?

Posted

Not exactly sure what your settings in LB look like or which tab you have the AHK pasted but below is what you should have set up. 

In LB bind your button(s) to close a game to the "Exit" option. In BB bind it to the "Close Active Window" option. 

Make sure the AHK you are suing is in the "Running Script" tab in the emulator set-up in LB. 

If still no luck try the script below instead. 

ESC::
{	
    SetTitleMatchMode, 2
    WinWaitActive, Cemu
    WinClose    			
}

 

Posted

The AHK was pasted in the running script section. Unfortunately I tried that code snippet and got the same result, it just takes it out of full screen.

Posted
5 minutes ago, sundogak said:

@JD78 with latest builds past 2.0 Alt F4 no longer works. See thread here.

TL;DR this works

ESC::
{	
    SetTitleMatchMode, 2
    WinWaitActive, Cemu
    WinClose      			
}

 

Same thing. Exits out of fullscreen, that's all.

Posted (edited)
7 minutes ago, JD78 said:

Same thing. Exits out of fullscreen, that's all.

what version of CEMU are you using? 

And...you went to that link and your windows for scripts are setup as noted in my more detailed post?

Edited by sundogak
add
Posted

Solution foundish. Just went back to Cemu 1.26.2f, the latest stable build as of this post. Closing Cemu works as intended now through the buttons, wish I had just done this sooner.

Posted (edited)

Just replying that I also am having the same exact problem running the latest version of Cemu 2.0. I have AHK setup exactly as sundogak does in his post, with exit game mapped to a controller in both launchbox and bigbox and cemu is not running as administrator (unless there's some sneaky option in LB that auto runs it as administrator that I don't know about) and it will not close, just exit fullscreen. I tried all the AHK setups people have linked in various posts and none of them work. If any of you very helpful smart people can figure it out I will be very grateful, I really don't want to revert Cemu back to an earlier version.

Edited by zeriah
Posted

So definitely something changed in the newer exp builds. Seems like you cannot use any shortcuts to close Cemu. You can jump in/out of fullscreen a bunch of different ways, but nothing for closing. 

Did some testing and the AHK below definitely works. I am no guru with this but it was something I had in my AHK notes from either something someone helped me with or I found a while back and just modified it for this use. So I cannot take any credit for it other than tinkering with it.  

SetTitleMatchMode, 2
Esc::PostMessage, 0x0112, 0xF060,,, Cemu

 

  • Thanks 2
Posted

Nice, thank you for that find. Since I went back to 1.26 and it works, I'm not going to jump back to 2.x but this should serve as a note going forward for others who will inevitably come across this problem.  At this time though, I really don't see a benefit in downloading Cemu 2.x over the stable build. I had a look at the change log and there's a couple improvements? But honestly can't see anything too groundbreaking. Appreciate you following up on the new builds.

Posted

Spent some time troubleshooting this. I was using Cemu v2.0-39 and LB v13.6. I then updated Cemu to v2.0-61 and notice no difference or any major issues. I could close the emulator fine, from fullscreen, with both keyboard or controller input. I'm thinking, huh, I'm the only one that doesn't have it messed up?

However, did notice combos like ALT+F4 didn't work as already mentioned. That was the only difference I noticed

I then updated to LB v13.9. Now controller "close active window" input does what everyone has shared. It exits fullscreen and goes into window mode instead. But I can still make use of keyboard input as my escape key hotkey that sends a WinClose command still works for me. So my workaround for closing Cemu with a controller is double click the Xbox guide button and it sends same WinClose command as if it were going to be triggered by physically hitting escape key.  If you aren't using an Xbox controller you can change the controller hotkey to whatever your preference is for your controller model. I'll include my entire Running Script field, you can remove one or the other hotkey if you want. Both of these scripts work for me.

 

Esc::WinClose, ahk_exe {{{StartupEXE}}}
Return

vk07:: ;Xbox guide button
If (A_ThisHotkey = A_PriorHotkey && A_TimeSincePriorHotkey < 300)
        WinClose, ahk_exe {{{StartupEXE}}}
Return

 

I have no issue still using WinClose. If WinClose isn't working for you then try the Post Message alternative.

Esc::PostMessage, 0x0112, 0xF060,,, ahk_exe {{{StartupEXE}}}
Return

vk07:: ;Xbox guide button
If (A_ThisHotkey = A_PriorHotkey && A_TimeSincePriorHotkey < 300)
        PostMessage, 0x0112, 0xF060,,, ahk_exe {{{StartupEXE}}}
Return
  • Thanks 1
Posted
6 hours ago, skizzosjt said:

TRY THIS


full_command_line := DllCall("GetCommandLine", "str")

if not (A_IsAdmin or RegExMatch(full_command_line, " /restart(?!\S)"))
{
    try
    {
        if A_IsCompiled
            Run *RunAs "%A_ScriptFullPath%" /restart
        else
            Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%"
    }
   ExitApp
}
 
SetTitleMatchMode, 2
DetectHiddenWindows, on
#SingleInstance, Force

$Esc::
{
WinClose, ahk_exe {{{StartupEXE}}}
}
 

Posted

Thanks for chiming in. Was hoping someone with better knowledge would. @skizzosjt Originally I did try a version of the first script you listed (sans the xbox portion) but it did not work. Looking back now I notice I had a typo (I tend to copy and paste scripts into notes so I can learn and keep track of things). So thanks for helping. 

Can confirm using skizzosjt script below works perfectly and is concise. 

Esc::WinClose, ahk_exe {{{StartupEXE}}}
Return

vk07:: ;Xbox guide button
If (A_ThisHotkey = A_PriorHotkey && A_TimeSincePriorHotkey < 300)
        WinClose, ahk_exe {{{StartupEXE}}}
Return

 

  • Like 2
Posted
On 12/15/2023 at 5:41 AM, Sbaby said:

TRY THIS


full_command_line := DllCall("GetCommandLine", "str")

if not (A_IsAdmin or RegExMatch(full_command_line, " /restart(?!\S)"))
{
    try
    {
        if A_IsCompiled
            Run *RunAs "%A_ScriptFullPath%" /restart
        else
            Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%"
    }
   ExitApp
}
 
SetTitleMatchMode, 2
DetectHiddenWindows, on
#SingleInstance, Force

$Esc::
{
WinClose, ahk_exe {{{StartupEXE}}}
}
 

This runs the script as an admin, which results in the UAC prompt popping up. Did you disable UAC down to "Never notify" on your system to get around that? Regardless, that's not necessary to close the emulator.  All that is needed in that script is the Esc hotkey (all lines above it should be deleted). The issue seems to be exclusive to using the "close active window" controller binding in Big Box or the "Exit Game" controller binding in LaunchBox. Keyboard input for closing Cemu works the same as it has in the past for both LaunchBox and Big Box.

Posted
1 hour ago, skizzosjt said:

This runs the script as an admin, which results in the UAC prompt popping up. Did you disable UAC down to "Never notify" on your system to get around that? Regardless, that's not necessary to close the emulator.  All that is needed in that script is the Esc hotkey (all lines above it should be deleted). The issue seems to be exclusive to using the "close active window" controller binding in Big Box or the "Exit Game" controller binding in LaunchBox. Keyboard input for closing Cemu works the same as it has in the past for both LaunchBox and Big Box.

Yes I have that disabled all the time. Anyway, mine was just a test attempt to help find the problem for our friend. . No I understood that it was only concerning the controller . Now everything is working with your scripts .😊

  • 4 weeks later...
Posted (edited)
On 12/14/2023 at 9:35 AM, Retro808 said:

So definitely something changed in the newer exp builds. Seems like you cannot use any shortcuts to close Cemu. You can jump in/out of fullscreen a bunch of different ways, but nothing for closing. 

Did some testing and the AHK below definitely works. I am no guru with this but it was something I had in my AHK notes from either something someone helped me with or I found a while back and just modified it for this use. So I cannot take any credit for it other than tinkering with it.  

SetTitleMatchMode, 2
Esc::PostMessage, 0x0112, 0xF060,,, Cemu

 

I tested all the scripts and it works on LB mode, but on BB using a controller and a PausePie theme gives me the screen attached, any way to fix that?

cemu-pause-menu.png

Edited by Oniontears

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