Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Bind different key for Exit Mame to key for Exit Game?  (Read 6276 times)

0 Members and 1 Guest are viewing this topic.

buttersoft

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1758
  • Last login:April 21, 2024, 08:06:32 am
  • Is running at 15kHz
Bind different key for Exit Mame to key for Exit Game?
« 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 :/

P.H.U.

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 219
  • Last login:April 29, 2023, 01:25:21 am
  • I own my own arcade machines. Word.
Re: Bind different key for Exit Mame to key for Exit Game?
« Reply #1 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.
When you find great deals on Craigslist for CRT based cabs, exuberance :laugh2: can be a bad thing!


Current Status of Cabs:  2-of-11 (and counting) working as desired  :applaud: :applaud:/:banghead: :banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead:

buttersoft

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1758
  • Last login:April 21, 2024, 08:06:32 am
  • Is running at 15kHz
Re: Bind different key for Exit Mame to key for Exit Game?
« Reply #2 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?
« Last Edit: March 06, 2016, 06:30:38 am by buttersoft »

P.H.U.

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 219
  • Last login:April 29, 2023, 01:25:21 am
  • I own my own arcade machines. Word.
Re: Bind different key for Exit Mame to key for Exit Game?
« Reply #3 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.
When you find great deals on Craigslist for CRT based cabs, exuberance :laugh2: can be a bad thing!


Current Status of Cabs:  2-of-11 (and counting) working as desired  :applaud: :applaud:/:banghead: :banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead:

P.H.U.

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 219
  • Last login:April 29, 2023, 01:25:21 am
  • I own my own arcade machines. Word.
Re: Bind different key for Exit Mame to key for Exit Game?
« Reply #4 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.
When you find great deals on Craigslist for CRT based cabs, exuberance :laugh2: can be a bad thing!


Current Status of Cabs:  2-of-11 (and counting) working as desired  :applaud: :applaud:/:banghead: :banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead:

buttersoft

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1758
  • Last login:April 21, 2024, 08:06:32 am
  • Is running at 15kHz
Re: Bind different key for Exit Mame to key for Exit Game?
« Reply #5 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...?
« Last Edit: March 06, 2016, 07:46:07 am by buttersoft »

machyavel

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 67
  • Last login:December 25, 2016, 10:23:52 am
Re: Bind different key for Exit Mame to key for Exit Game?
« Reply #6 on: March 06, 2016, 06:04:26 pm »
in mame.ini:

confirm_quit              1

buttersoft

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1758
  • Last login:April 21, 2024, 08:06:32 am
  • Is running at 15kHz
Re: Bind different key for Exit Mame to key for Exit Game?
« Reply #7 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 :)

buttersoft

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1758
  • Last login:April 21, 2024, 08:06:32 am
  • Is running at 15kHz
Re: Bind different key for Exit Mame to key for Exit Game?
« Reply #8 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.

buttersoft

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1758
  • Last login:April 21, 2024, 08:06:32 am
  • Is running at 15kHz
Re: Bind different key for Exit Mame to key for Exit Game?
« Reply #9 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)

Jamesbeat

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 261
  • Last login:February 11, 2019, 06:13:39 pm
  • I want to build my own arcade controls!
Re: Bind different key for Exit Mame to key for Exit Game?
« Reply #10 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
« Last Edit: March 17, 2016, 12:38:45 pm by Jamesbeat »