Jump to content
LaunchBox Community Forums

CEMU Exit Command Line


TheChopman

Recommended Posts

Go to tools -> Manage emulator, select your Cemu emulator and add the the following to the Running AutoHotKey Script tab:

$Esc::
{
    Process, Close, {{{StartupEXE}}}
} 

Add the following to the Exit AutoHotKey Script tab:
 

Process, Close, {{{StartupEXE}}}

 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

I would recommend using a different version of that code. That old version is a hard close and can cause issues with emulators not saving save states properly. It was something that was found last year. I would use the code below instead. Not that the prior one did not work, this is just a cleaner shutdown process.

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

More appropriately since Cemu use Alt+F4

ESC::
{   
    SetTitleMatchMode, 2
    WinWaitActive, Cemu
    Send !{f4}               
}

All scripts to close a game while in the game go in the "Running AHK" within Launchbox. The "Exit" script tab is for issue closing from the LB Pause Menu. 

 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • 5 weeks later...

Hey, All

So I updated Cemu to 1.18.2 and launchbox to 10.14 and now I can't get Cemu to close with my Xbox controller. I use the select button + start button to close all my emulators and Cemu is the only one to stop working.

I have

 $Esc::
{
    Process, Close, {{{StartupEXE}}}
}

for my AHS

and 

Process, Close, {{{StartupEXE}}}

for my close script.

I've tried a bunch of other scripts with no luck thus far. Any ideas?

I also don't have cemu running in administrative mode  because that disabled my esc command to close out with a keyboard.

 

Link to comment
Share on other sites

@Jake612

CEMU uses Alt-F4 to close in standalone mode.  So this is what I use and this works on current versions of CEMU and LB:

In the CEMU Emulator Tab  "Exit AutoHotkey Script" put this in:

Send !{f4}   

The above will work in the Pause Screen exit command as well as whatever controller combination you set up in LB for exit game.  The "Process Close" AHKs given in the past have been found to not always be reliable.  Plus, the Alt-F4 is what CEMU expects as normal exit anyway. 

Optional:  If you also want to use the keyboard Escape key to exit then optionally add this in the "Running AutoHotkey Script" tab:

ESC::
{   
    SetTitleMatchMode, 2
    WinWaitActive, Cemu
    Send !{f4}               
}

You shouldn't need to run CEMU in admin mode for either of these or really any reason I can think of at least for BB/LB usage.

Edited by sundogak
  • Like 2
  • Thanks 2
Link to comment
Share on other sites

16 minutes ago, sundogak said:

@Jake612

CEMU uses Alt-F4 to close in standalone mode.  So this is what I use and this works on current versions of CEMU and LB:

In the CEMU Emulator Tab  "Exit AutoHotkey Script" put this in:


Send !{f4}   

The above will work in the Pause Screen exit command as well as whatever controller combination you set up in LB for exit game.  The "Process Close" AHKs given in the past have been found to not always be reliable.  Plus, the Alt-F4 is what CEMU expects as normal exit anyway. 

Optional:  If you also want to use the keyboard Escape key to exit then optionally add this in the "Running AutoHotkey Script" tab:


ESC::
{   
    SetTitleMatchMode, 2
    WinWaitActive, Cemu
    Send !{f4}               
}

You shouldn't need to run CEMU in admin mode for either of these or really any reason I can think of at least for BB/LB usage.

Thank you for the response!

My computer restarted and it magically worked again without me doing anything. No idea why but I'm not complaining.

Link to comment
Share on other sites

  • 8 months later...

Sorry that this topic is old and I'm replying to it now.  I tried all of the above proposed solutions and couldn't get any of them to work.  I can press Alt + F4 on my keyboard to close Cemu but I can't get the emulator to close from my wireless Xbox 360 controller.  LIke a poster above, I also press Start + Select to exit all other emulators like RetroArch.  But pressing those buttons on the controller when using Cemu does nothing but bring up a menu in the game.  Does anyone know how to can get the Cemu emulator to close by pressing start and select at the same time on my controller when the emulator is launched from within Launchbox/Bigbox?  Any help is appreciated.

UPDATE:

Figured it out.  Just had to set cemu.exe to NOT run as administrator and remove everything from the running and exit scripts.

Edited by djdaveoc22
Link to comment
Share on other sites

  • 2 years later...
On 5/6/2020 at 3:35 PM, sundogak said:

@Jake612

CEMU uses Alt-F4 to close in standalone mode.  So this is what I use and this works on current versions of CEMU and LB:

In the CEMU Emulator Tab  "Exit AutoHotkey Script" put this in:

Send !{f4}   

The above will work in the Pause Screen exit command as well as whatever controller combination you set up in LB for exit game.  The "Process Close" AHKs given in the past have been found to not always be reliable.  Plus, the Alt-F4 is what CEMU expects as normal exit anyway. 

Optional:  If you also want to use the keyboard Escape key to exit then optionally add this in the "Running AutoHotkey Script" tab:

ESC::
{   
    SetTitleMatchMode, 2
    WinWaitActive, Cemu
    Send !{f4}               
}

You shouldn't need to run CEMU in admin mode for either of these or really any reason I can think of at least for BB/LB usage.

Sorry for the necro bump but...hopefully this will help someone else. After hours of searching and trying different scripts, this is the one that FINALLY solved my issue. Much appreciated!

Link to comment
Share on other sites

  • 2 months later...
On 6/6/2023 at 3:53 AM, zugswang said:

Does anyone know how to exit on latest Cemu ?

Tried all the above and no luck, so looks like something has changed.

Loads fine, just can't exit using XBOX One controller

Thanks

I suspect this is a bug in version 2.0 since ALT Enter takes out of full screen.  However, running standalone or LB now ALT F4 doesn't work with window active.  However, this does seem to work and suspect more elegant closure than Alt F4.  

ESC::WinClose

Or if want to make sure it is closing the CEMU window only:

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

 

Thus my LB setup looks like this which allows either using keyboard ESC to exit or using the Pause Menu function, and then Exit to close CEMU window. 

image.png.f38a29a35d28050ce610907074a4669a.png

 

image.png.b1fbeae27d9cdd48f685ae22e2cdfd4e.png

Edited by sundogak
added screen shots
  • Like 3
  • Thanks 2
  • The Cake is a Lie 1
Link to comment
Share on other sites

6 hours ago, sundogak said:

I suspect this is a bug in version 2.0 since ALT Enter takes out of full screen.  However, running standalone or LB now ALT F4 doesn't work with window active.  However, this does seem to work and suspect more elegant closure than Alt F4.  

ESC::WinClose

Or if want to make sure it is closing the CEMU window only:

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

 

Thus my LB setup looks like this which allows either using keyboard ESC to exit or using the Pause Menu function, and then Exit to close CEMU window. 

image.png.f38a29a35d28050ce610907074a4669a.png

 

image.png.b1fbeae27d9cdd48f685ae22e2cdfd4e.png

Thanks 👍

Works perfectly.

Link to comment
Share on other sites

7 hours ago, sundogak said:

I suspect this is a bug in version 2.0 since ALT Enter takes out of full screen.  However, running standalone or LB now ALT F4 doesn't work with window active.  However, this does seem to work and suspect more elegant closure than Alt F4.  

ESC::WinClose

Or if want to make sure it is closing the CEMU window only:

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

 

Thus my LB setup looks like this which allows either using keyboard ESC to exit or using the Pause Menu function, and then Exit to close CEMU window. 

image.png.f38a29a35d28050ce610907074a4669a.png

 

image.png.b1fbeae27d9cdd48f685ae22e2cdfd4e.png

That worked for me as well. Thanks a lot for sharing!

Link to comment
Share on other sites

  • 4 weeks later...
On 6/7/2023 at 8:33 PM, sundogak said:

I suspect this is a bug in version 2.0 since ALT Enter takes out of full screen.  However, running standalone or LB now ALT F4 doesn't work with window active.  However, this does seem to work and suspect more elegant closure than Alt F4.  

ESC::WinClose

Or if want to make sure it is closing the CEMU window only:

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

 

Thus my LB setup looks like this which allows either using keyboard ESC to exit or using the Pause Menu function, and then Exit to close CEMU window. 

image.png.f38a29a35d28050ce610907074a4669a.png

 

image.png.b1fbeae27d9cdd48f685ae22e2cdfd4e.png

Success! Thank You!

Link to comment
Share on other sites

I’m running launchbox like a console, playing games from the couch via an 8BitDo Sn30 Pro controller.

Anybody know how to exit Dolphin and CEMU with an xinput controller?

I know “esc” is the best working solution but I’d prefer to use the controller.


Please help… thanks

***UPDATE***

Figured it out, I downloaded a different version and now I can exit via pause menu.

Edited by Ipman559
Link to comment
Share on other sites

32 minutes ago, Ipman559 said:

I’m running launchbox like a console, playing games from the couch via an 8BitDo Sn30 Pro controller.

Anybody know how to exit Dolphin and CEMU with an xinput controller?

I know “esc” is the best working solution but I’d prefer to use the controller.


Please help… thanks

Option 1: Use the above AHK commands in LB. Use the exit from the LB pause menu using the controller.  This assumes you have mapped a controller button to Show Pause Screen (under Options, Game Controllers) within LB.   Option 2: map winclose command via AHK, but don't know the specifics for your controller.  

Link to comment
Share on other sites

5 hours ago, k_rollo said:

Hi @sundogak , what would be the difference of your ESC script from @Retro808 ? Which one is more elegant?

Not about one being better.  The issue is that the newer versions of CEMU no longer close with ALT F4 command as worked prior (and I used as well so Retro’s was great). This could be a CEMU bug but at least for moment going back to winclose method works.  If using older version then stick with Retro’s.

Edited by sundogak
  • Like 1
Link to comment
Share on other sites

8 hours ago, sundogak said:

Not about one being better.  The issue is that the newer versions of CEMU no longer close with ALT F4 command as worked prior (and I used as well so Retro’s was great). This could be a CEMU bug but at least for moment going back to winclose method works.  If using older version then stick with Retro’s.

Thanks, Retro808's version does appear to work with other emulators too. I use it in RPCS3, Model 2 Emulator, and Cemu.

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