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: Prevent FE (Checkered Flag) from exiting to Windows  (Read 1864 times)

0 Members and 1 Guest are viewing this topic.

shess

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 162
  • Last login:January 07, 2021, 04:17:28 pm
Prevent FE (Checkered Flag) from exiting to Windows
« on: February 23, 2017, 03:42:04 pm »
I'm sure this has been handled many times before, but I can't seem to find the solution. I'm using the Checkered Flag FE with the Model 2 emulator (and maybe Supermodel down the road). I've added one button to my control panel and assigned it to the ExitFE function (escape) using Joy2Key. It works as expected in Model2, it exits the game and goes back to the FE. However I know how people can be and sometimes they hit the button multiple times if it doesn't react as fast as they want and then it drops to Windows. I tried changing the Ascii value in the keys.txt file to a different button to see if it would exit the emulator but not the FE and the issue persists. How do I prevent this?

shess

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 162
  • Last login:January 07, 2021, 04:17:28 pm
Re: Prevent FE (Checkered Flag) from exiting to Windows
« Reply #1 on: February 28, 2017, 03:20:42 pm »
Do most people use Hyperspin or something else for their FrontEnd needs and don't have to worry about multiple exit commands?

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19400
  • Last login:April 15, 2024, 10:59:21 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Prevent FE (Checkered Flag) from exiting to Windows
« Reply #2 on: March 02, 2017, 03:23:53 am »
I'm not sure man.  The FE never caught on like I wanted it to, which is strange as, for racing games at least, it's pre-configured which is what everyone asked for. 

It's been a while since I worked on that stuff, but if I remember correctly it's actually the way the script works that is killing the FE and there isn't much you can do about it.  In the lua script esc is pressing alt+f4, the universal shortcut to kill a program.  So the script would have to be modified to use another method. 

I don't have my notes on hand, so I could be wrong about that.

buttersoft

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1758
  • Last login:March 22, 2024, 12:55:20 am
  • Is running at 15kHz
Re: Prevent FE (Checkered Flag) from exiting to Windows
« Reply #3 on: March 02, 2017, 09:27:10 pm »
Assign profiles to applications in JoyToKey. That way the Esc bind is only valid as long as Model 2 Emu is in focus, and when M2Emu closes and the focus goes back to the CF FE, JoytoKey switches profiles, and you can have different bindings or none at all. Vice versa too, obviously.

Or is that what you're already doing, and the keypresses get buffered so it goes back to windows anyway?

If that's the case, some creative autohotkey scripting should do the trick. Have a batch file launch M2Emu and the AHK script, which latter would bind a keypress to deliver a different keypress, once, and then rebind itself to nothing. Then the script closes once M2emu is dead. Might need JoyToKey to deliver the first keypress for AHK though. I find it a bit niggly, so the first option would be better if you can use it.

EDIT: Just remembered - there's a function in JoyTokey to bind 4 keys to the one button. Pressing that button four times triggers each binding once, in order, then repeat. That might help fudge it as well. I don't think there's a function to change a binding based on a press.

Can you not simply bind the key to exit M2Emu to something else, and use profiles like in the first idea?
« Last Edit: March 02, 2017, 10:28:23 pm by buttersoft »

shess

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 162
  • Last login:January 07, 2021, 04:17:28 pm
Re: Prevent FE (Checkered Flag) from exiting to Windows
« Reply #4 on: March 05, 2017, 10:59:31 pm »
Thanks for all the suggestions. I wasn't too familiar with the Joy2Key profiles nor the AHK scripts so I might have just done them wrong. But I did finally come up with a solution. In the keys.txt file, I map ExitFE to something other then Escape, like End. Then in the joystick.txt file, I remove the ExitFE line from any of the buttons. In the Joy2Key default profile, I map the control panel button to Escape. So when I go into CF, the button is mapped to Escape but the ExitFE signal is End. When I'm in the game, Escape is already mapped to Alt-F4 (according to Howard's message) and therefore it exits back to the FE. The only way to kill the FE is by hitting End on a keyboard. Problem solved!