Jump to content
LaunchBox Community Forums
Lukeyboy67

Exiting games in MAME....

Recommended Posts

I use my gamepad to exit games in almost all of my emulators. I play MAME the most and find it really irritating having to hit escape when I wanna quit a game. Is there any way to do it?

Cheers :)

Share this post


Link to post
Share on other sites

Launchbox's Controller Automation button combo will do this for you. The button combo sends the Escape command to the PC shutting down the emulator as long as it supports Escape to close it. Some emulators don't and in those cases an AHK script can be set for the emulator in LB to send the close emulator command to it.

  • Like 1

Share this post


Link to post
Share on other sites

You can also set the UI Cancel button in MAME to the same combo you use for everything else, and that will exit also.

  • Like 1

Share this post


Link to post
Share on other sites

Yeah that too, forgot that you can set a controller combo in Mame itself.

  • Like 1

Share this post


Link to post
Share on other sites

Easy, you use a keyboard when setting it up and map a button or button combo of your choice in Mame or in LB.

  • Like 1

Share this post


Link to post
Share on other sites

Hi Guys,  JJ helped me by creating this ahk script for me.

Holding joystick button 10 (my start button) for 5 seconds exits mame.

$joy10:: ; my start button
{
	keywait, joy10, t5
	if errorlevel <> 0
	{
	Send {esc down}{esc up}
	}
}

 

 

 

  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)

Super noob question I guess but I copied and pasted your ahk code into the ahk section of tools>"edit" emmulators in launch box.  Then I changed your joy10 to my joy1 key in Mame which is mapped to my player 1 button.   Loaded a game in Mame and tried to exit holding the key for 5 and it didn't exit. Any help would be appreciated.  Is it because I already have that key mapped to "p1 start"? I also do not have premium version yet so I cannot set buttons in launch box as Lordmonkus suggested. Looked in mame64 but could not find an escape key to map a button to. 

Edited by omlifecrew

Share this post


Link to post
Share on other sites

Just go into MAME and set your own combo for the ui exit in MAME it will save you a bunch of hassle.

  • Like 1

Share this post


Link to post
Share on other sites

To test ahk script open mame and press escape on keyboard to exit.

Also go into control panel in windows and test game pad settings to make sure your button is number 1

 

Share this post


Link to post
Share on other sites

The script has a slight issue where he the game starts because you have credits in the machine or is on free play you may have to hold button again for 5 seconds. But will exit 99% of the time

Share this post


Link to post
Share on other sites

Its just much simpler to open the tab menu go to controls general/user interface/ find UI cancel and set whatever button or button combo you want.

  • Like 1

Share this post


Link to post
Share on other sites

yeah why use a 3rd party workaround for an emulator that has a built in solution. MAME doesn't like simulated keyboard presses that is why it is problemsome.

Share this post


Link to post
Share on other sites

In my case I have 8 arcade button control panel for each player. So start and exit button is very useful.

Fyi midway games save on mame exit so killing tasks in windows or alt f4 will not save your game

Share this post


Link to post
Share on other sites

On my arcade machine I have it set in Mame to use coin and another button simultaneously to exit from game. Using the UI cancel built into MAME isn't the same as using Alt-F4 basically you are taking the built in Escape function in MAME and adding it to a button combo so it is cleanly shutting MAME down. Whatever works for anyone is great but the simplest solution is to use the one built into MAME.

  • Like 1

Share this post


Link to post
Share on other sites

Thank you all so much for the help.  I didn't even know there was a "UI settings".  Got my MAME exiting now in launchbox.  Super excited.

  • Like 1

Share this post


Link to post
Share on other sites

Shoud've just read what Neil9000 said. 2nd post after my original question....

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×