Author Topic: Exit to Menu  (Read 4139 times)

Misterhollyw00d

  • Full Member
  • ***
  • Posts: 45
    • View Profile
Exit to Menu
« on: August 12, 2020, 11:00:59 PM »
I found this guys coding on reddit.
https://icculus.org/finger/icculus?date=2019-12-27&time=02-04-18

What he does is provide a killswitch. By holding a button down for 5 seconds it will exit you out of any emulator back to the menu screen. Without using hotkey or a button combination.

I've used the code and it works but for some reason when trying to do this after launching a rom in attract mode it will not work. Only works in emulationstation.

placebo_yue

  • Full Member
  • ***
  • Posts: 57
  • sup
    • View Profile
    • Instagram
Re: Exit to Menu
« Reply #1 on: August 13, 2020, 10:23:17 AM »
Why not just set an AM exit button? It's simple enough and works without trouble.
Otherwise, what i do is create joy2key profiles for every emulator and map the same button (the Xbox controller ON/MENU button) to each emulator's exit hotkey (alt+f4, alt+x, ESC, ctrl+F9...) since AM doesn't recognise that one for some reason and it's the one i like to use

Misterhollyw00d

  • Full Member
  • ***
  • Posts: 45
    • View Profile
Re: Exit to Menu
« Reply #2 on: August 13, 2020, 11:31:30 AM »
Thing is I’m using it on an arcade cab where there is kids or friends that come over Will button smash. The hard press prevents exit being used

It works fine in emulationstation

I’m not good with coding. If someone can fix script and get it to work

Misterhollyw00d

  • Full Member
  • ***
  • Posts: 45
    • View Profile
Re: Exit to Menu
« Reply #3 on: August 13, 2020, 11:41:49 AM »
If I do set the button as exit. Anyway to make it activate by a hard press 2 seconds

hermine.potter

  • Hero Member
  • *****
  • Posts: 767
    • View Profile
Re: Exit to Menu
« Reply #4 on: August 13, 2020, 03:52:57 PM »
you have to replace in file arcade1up-killswitch-gpio.c, emulationstation with something like attract (do not know, how correct task of attractmode on RPI/Linux is called (Find correct process name)) and do further steps from your link.
AM Version : 2.6.1
Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
Cabinet : Yes
OS : Windows10 Pro
System : Dell Precision T3500 ; Intel X5650 ; 12GB RAM

placebo_yue

  • Full Member
  • ***
  • Posts: 57
  • sup
    • View Profile
    • Instagram
Re: Exit to Menu
« Reply #5 on: August 13, 2020, 10:07:45 PM »
I wrote a reply but i guess my internet died and it never sent.
Joy2key lets you change behaviour with a time threshold.
that means. Whatever key you map, you can tell it to to something (in your case nothing) or, past 2000 milliseconds, trigger the exit hotkey.
I dunno if you can use joy2key in raspberry pi, but in any case, it might help someone else.

Misterhollyw00d

  • Full Member
  • ***
  • Posts: 45
    • View Profile
Re: Exit to Menu
« Reply #6 on: August 21, 2020, 05:27:38 PM »
This would be great!

I never realized AM had the exit key when u go into emulator.
I also saw a pause option there. I think a reset game would of been better though.

But the exit emulator is great. Much better than using hotkey and exit as that sometimes don't work. Plus when ur in loading screen or on game launching image u are able to exit out as well. Plus able to use button combo from 2 different usb ports. Something that you can't do with hotkeys alone.

I just wish someone can code something for the exit emulator feature to have a delay press to activate. This way I can map player 1 as my start button but also as my exit if you press and hold it.

hermine.potter

  • Hero Member
  • *****
  • Posts: 767
    • View Profile
Re: Exit to Menu
« Reply #7 on: August 22, 2020, 04:23:28 AM »
Have a look here
-wire it to GPIO as you wish
-instead shutdown and/or reboot, you use killall processname_of_your_emulator
AM Version : 2.6.1
Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
Cabinet : Yes
OS : Windows10 Pro
System : Dell Precision T3500 ; Intel X5650 ; 12GB RAM