Build Your Own Arcade Controls Forum

Software Support => GroovyMAME => Topic started by: buttersoft on March 05, 2016, 11:03:39 pm

Title: Bind different key for Exit Mame to key for Exit Game?
Post by: buttersoft on March 05, 2016, 11:03:39 pm
Is it possible to bind a different key/combination for Exit Game to the one used for Exit Mame? UI Cancel seems to do both? While testing I rebound it to "m" (random key i wasn't using) and it would let me exit game/go back, but *wouldn't* exit Mame. I had to select the option with arrows/stick to do that.

Now I'm setting up my cab, with a pair of zero-delay usb boards, and the three-button combo i want to use works to go back but will *also* exit Mame. (The three buttons I'm using are also Coin 1, Start 1, and Start 2, if that makes any difference). Given i'd like this cab to be used by those drinking, as well as by my children when they grow up a bit, I'd ideally like a button combo to exit game and go back in menus, but that *won't* Exit Mame, so you have to select the option with the stick and can't accidentally wind up at the desktop having to reboot the PC...

Can this be done in MAME, or at least simply, or am i going to have to do something painful with autohotkey? I've been googling this for a few weeks but can't seem to find anything :/
Title: Re: Bind different key for Exit Mame to key for Exit Game?
Post by: P.H.U. on March 06, 2016, 03:55:28 am
Yeap, works fine. But best you start over. Delete or rename your config folder. Launch any game. Hit TAB. Navigate to whatever function is mapped to ESC, hit enter, and key in your button commands. If somewhere you messed up, just delete the files in the config folder and start over.
Title: Re: Bind different key for Exit Mame to key for Exit Game?
Post by: buttersoft on March 06, 2016, 06:26:23 am
Yeap, works fine. But best you start over. Delete or rename your config folder. Launch any game. Hit TAB. Navigate to whatever function is mapped to ESC, hit enter, and key in your button commands. If somewhere you messed up, just delete the files in the config folder and start over.

Doesn't work. Exactly the same thing happens. I rebind UI Cancel to that button combo in the OP, and while it lets me skip back out of game, or up levels in menus, which I want, it *also* lets me exit Mame and go to desktop, which I don't want.

As I said, I had it working if bound to the 'm' key, though I haven't tried to replicate that. "M" would exit game, but not exit mame even when pressed again from the home screen.

Or have I misunderstood? Are you implying doing something more than rebinding UI Cancel?
Title: Re: Bind different key for Exit Mame to key for Exit Game?
Post by: P.H.U. on March 06, 2016, 06:41:53 am
No, I misunderstood you. I get now. You don't want to exit the emulator at all due to drunk people at your house.

Another way you can go about this is with a front end to run MAME. Like if you use HyperSpin, you can escape out of the game back into the FE. If escape is hit again, an exit confirmation screen pops up. If the user executes the escape command from there, it cancels the escape nag screen and they are brought back to the FE. And if they are sober/drunk enough to exit out of the FE from there, well........

I don't know how other FE's handle this though. I am just a HyperSpin guy.
Title: Re: Bind different key for Exit Mame to key for Exit Game?
Post by: P.H.U. on March 06, 2016, 06:47:41 am
Sorry. I forgot. Yes, it should be possible. I believe there is just a CANCEL function in MAME. So you would want your button stroke commands to map to just CANCEL. Then leave the commands for UI CANCEL null. Should work. Check it.
Title: Re: Bind different key for Exit Mame to key for Exit Game?
Post by: buttersoft on March 06, 2016, 07:34:07 am
Sorry. I forgot. Yes, it should be possible. I believe there is just a CANCEL function in MAME. So you would want your button stroke commands to map to just CANCEL. Then leave the commands for UI CANCEL null. Should work. Check it.

I really don't want to use a frontend. I'll give that command a look. Thanks for trying to help :)

EDIT: so no, there doesn't seem to be another command. Cancel *is* UI cancel. It's a UI command, hence the prefix. There is no other cancel command.

I wonder how I got it to work before...?
Title: Re: Bind different key for Exit Mame to key for Exit Game?
Post by: machyavel on March 06, 2016, 06:04:26 pm
in mame.ini:

confirm_quit              1
Title: Re: Bind different key for Exit Mame to key for Exit Game?
Post by: buttersoft on March 06, 2016, 07:57:47 pm
in mame.ini:

confirm_quit              1

TY, will give that a look. Better than nothing, at any rate :)
Title: Re: Bind different key for Exit Mame to key for Exit Game?
Post by: buttersoft on March 07, 2016, 07:29:38 am
in mame.ini:

confirm_quit              1

That, it turns out, makes MAME ask for confirmation before you exit a running game. That's closer to the opposite of what I want.

What I want is a way to make the key combo that exits a game different to the combo that exits MAME.

I figured out it can be done by using a letter key for UI Cancel. I think it works because it exits a game, but in the MAME list, the letter keys work to seek the cursor - when you type "j" it jumps to games starting with the letter "j". So a letter key won't exit MAME, or anyway won't exit GroovyMAME. But I want to do it with a cab, using USB joystick buttons.

I guess I'm going to have to try autohotkey or x-padder or something.
Title: Re: Bind different key for Exit Mame to key for Exit Game?
Post by: buttersoft on March 08, 2016, 04:46:30 am
So Joytokey and Xpadder won't work as MAME/GM doesn't take d_input commands, only low level commands. Will autohotkey suffer from the same, does anyone know?

(I'm on Win7, so no recompiling for me)
Title: Re: Bind different key for Exit Mame to key for Exit Game?
Post by: Jamesbeat on March 17, 2016, 12:31:37 pm
I had this same problem on my raspberry pi - it was too easy (drunk or sober) to hit the exit button twice and accidentally exit mame.
Sometimes there is a slight delay between exiting a game and the game actually closing, so you would think that you didn't press the button properly and press it again.

I'm afraid I can't remember how I fixed it, but I did get it to work, and I am using hacked gamepads too, not a keyboard.

I am using advancemenu with mame4all, and I think they each have their own config files. I was able to set different buttons to exit a game and to exit the emulator, so I can exit a game without accidentally exiting advmenu.
I bound a different button to exit advmenu, and told the pi to shut down upon quitting advmenu, so I have a button that shuts down the pi.

This does seem to be a glaring oversight, and I'm afraid you may have no choice but to use a front end.but