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: Exit emulator when ESC is pressed  (Read 12206 times)

0 Members and 1 Guest are viewing this topic.

astrog21

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:December 05, 2015, 06:17:48 am
Exit emulator when ESC is pressed
« on: March 14, 2014, 02:03:00 am »
Hi there,

I am new to forums, so sorry if I do something wrong.

On my cab, I have a button on the control panel that is wired to the ESC key. When I press it, it exits MAME and goes back in HyperSpin. Unfortunatley, the button does not exit other emulators (Boycott Advance, kat5200, Fusion e.t.c.).

I want it so that the ESC key will exit any programs except for HyperSpin (HyperSpin.exe). Is there a way to set up something like AutoHotKey, so ESC acts like Alt+F4, EXCEPT FOR HyperSpin.

I have no idea how to use AutoHotKey. Please help me!

FYI The PC is running Windows XP SP2

EMDB

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 865
  • Last login:September 05, 2023, 09:18:51 am
  • Project RetroCade
Re: Exit emulator when ESC is pressed
« Reply #1 on: March 14, 2014, 03:11:49 am »
Hi there,

I am new to forums, so sorry if I do something wrong.

On my cab, I have a button on the control panel that is wired to the ESC key. When I press it, it exits MAME and goes back in HyperSpin. Unfortunatley, the button does not exit other emulators (Boycott Advance, kat5200, Fusion e.t.c.).

I want it so that the ESC key will exit any programs except for HyperSpin (HyperSpin.exe). Is there a way to set up something like AutoHotKey, so ESC acts like Alt+F4, EXCEPT FOR HyperSpin.

I have no idea how to use AutoHotKey. Please help me!

FYI The PC is running Windows XP SP2
Use HyperLaunch. It is designed to exactly do what you want (and much more)...

astrog21

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:December 05, 2015, 06:17:48 am
Re: Exit emulator when ESC is pressed
« Reply #2 on: March 14, 2014, 05:28:32 am »
Thank you! I will give that a try tomorrow and let you know how it goes.

astrog21

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:December 05, 2015, 06:17:48 am
Re: Exit emulator when ESC is pressed
« Reply #3 on: March 16, 2014, 03:08:00 am »
How would I do this? I have no idea how to use AutoHotKey or HyperLaunchHQ and can't find any useful websites. Is there a website on how to use both of these programs, and some sample scripts for AHK?

Thanks for the help though. I will  play around with them some more and try to work it out.

zorrobandito

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 134
  • Last login:November 22, 2015, 07:19:44 am
    • Zorro's Classic Games
Re: Exit emulator when ESC is pressed
« Reply #4 on: March 22, 2014, 09:09:28 am »
I struggled a bit with AutoHotKey at first, so here's a sample script that sends Alt-F4 when you press Esc:

ESC::
    Send !{F4}
    ExitAPP
return


Now you need to run this when you run the emulator. You could use a batch file or add it to a pre-command line in your front-end.

keilmillerjr

  • Trade Count: (+5)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1847
  • Last login:October 06, 2023, 10:20:39 pm
  • Web Developer.
Re: Exit emulator when ESC is pressed
« Reply #5 on: March 22, 2014, 10:47:17 am »
I struggled a bit with AutoHotKey at first, so here's a sample script that sends Alt-F4 when you press Esc:

ESC::
    Send !{F4}
    ExitAPP
return


Now you need to run this when you run the emulator. You could use a batch file or add it to a pre-command line in your front-end.

Or you could run it all the time and make that hot key only return the alt + f4 when the emulator process is running.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:July 03, 2025, 06:36:13 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Exit emulator when ESC is pressed
« Reply #6 on: March 22, 2014, 06:29:18 pm »
Yeah the proper way to do it is to do a loop checking for the existence of the app in question as well. 

Just for the record I made wrappers that handle off of this, they are on my site and well over 12 years old.  They pre-date ahk and all that jazz though.

Kids today never look to see if something exists, but rather complain about it begging for help.  ;)

Xris

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 3
  • Last login:June 21, 2014, 08:22:43 am
Re: Exit emulator when ESC is pressed
« Reply #7 on: June 21, 2014, 08:13:17 am »
Yeah the proper way to do it is to do a loop checking for the existence of the app in question as well. 

Just for the record I made wrappers that handle off of this, they are on my site and well over 12 years old.  They pre-date ahk and all that jazz though.

Kids today never look to see if something exists, but rather complain about it begging for help.  ;)

Maybe you could be a little more specific? Like the name of the wrapper? Some have not heard of the "The Dragon King" and they come here for help. You try googling what this guy is talking about and see what you come up with. People arent "idiots" because they dont know. They just have better things to do. FYI, Your "Fixed it Felix" app doesnt fix it felix. If you map a button to the "c" key, it adds still adds credits and if you map the space bar to use the hammer, it jumps and hammers at the same time. Maybe you can look to see if something exists to help with that issue.

EMDB

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 865
  • Last login:September 05, 2023, 09:18:51 am
  • Project RetroCade
Re: Exit emulator when ESC is pressed
« Reply #8 on: June 21, 2014, 12:08:09 pm »
Code: [Select]
RunWait, snes9x.exe "%1%"
ExitApp
Esc::Send !{f4}
1::Space
2::Return

This way you can launch an emulator, pass a parameter (the game) and remap multiple keys only while the emulator is running.

empardopo

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 526
  • Last login:July 02, 2025, 07:02:58 am
    • My personal forum
Re: Exit emulator when ESC is pressed
« Reply #9 on: June 23, 2014, 01:50:01 am »
You can also take a look at my AllInOneFYC program.
You have the link and tutorial in my signature.

Greetings!

kaptainsteve

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 70
  • Last login:February 18, 2024, 01:30:53 pm
    • Swamp-Ass
Re: Exit emulator when ESC is pressed
« Reply #10 on: June 26, 2014, 07:55:27 pm »