tmreith Posted August 21, 2020 Share Posted August 21, 2020 (edited) Hello - I have searched the forums for days and I can't seem to find a real solution for Launchbox/Bigbox and Pinball FX3 via Steam. PROBLEM: Within Bigbox/Launchbox, ESCAPE key ignores the AutoHotKey script to send [ALT][F4] to exit. Pinball FX3 goes to PAUSE screen within FX3 and you must navigate to exit out of FX3 application. Without Bigbox/Launchbox, running the AutoHotKey script below prior to command line launch of FX3 Esc:: Send, !{F4} return -OR- Esc:: Send, {Alt down} Sleep 50 Send, {F4 down} Sleep 50 Send, {Alt up} Sleep 50 Send, {F4 up} return Below is the command line that I use to launch FX3 with Fish Tales table C:\Steam\Steam.exe -applaunch 442120 -class -table_WMS_Fish_Tales Pressing ESCAPE key properly executes the AHK logic (ALT F4) and Pinball FX3 immediately exits back to desktop. Something is going on in Launchbox/Bigbox that is changing the behavior of how AHK and FX3 are playing together. LAUNCHBOX Setup: STEAM/Pinball FX3 is configured for CABINET MODE with Zen activation code. Emulator settings for Pinball FX3: Set the Emulator Application Path to wherever your "Steam.exe" is. Do not point to "Pinball FX3.exe" (STEAM errors will occur) For Default Command-Line Parameters add "-applaunch 442120 -table_" Or for FX3 Classic Table add "-applaunch 442120 -class -table_" - NOTE the "-class" before table Select Don't use quotes Select No space before ROM Select Use file name only without file extension See below Sample Command shows up as "Steam.exe -applaunch 442120 -table_File" Tables properly load seamlessly within Bigbox and Launchbox - No problems Now to Exit: Edited August 21, 2020 by tmreith Quote Link to comment Share on other sites More sharing options...
tmreith Posted August 23, 2020 Author Share Posted August 23, 2020 SOLVED Required AutoHotKey executable script to launch FX3 to see ESC key to exit. I placed the FX3_Launcher_Classic.exe in the Stem root directory. Below is the AHK script. This needs to be compiled on your system - RIGHT click and select Compile Script to create EXE. I had to install AutoHotKey on my system to compile script. https://www.autohotkey.com/ ;FX3_Launcher_Classic.EXE SCRIPT - Pinball FX3 ;Use ESC from keyboard to exit FX3. #SingleInstance, Force Run, "e:\steam\Steam.exe" -applaunch 442120 -class -table_"%1%" #IfWinActive ahk_exe Pinball FX3.exe SendMode, Input $Esc:: Process, Close, Pinball FX3.exe ExitApp return $vk07:: Process, Close, Pinball FX3.exe ExitApp return Emulator settings for Pinball FX3: Set the Emulator Application Path to wherever your "FX3_Launcher_Classic.exe" is. For Default Command-Line Parameters NONE Or for FX3 Classic Table add "-applaunch 442120 -class -table_" - NOTE the "-class" before table Select Don't use quotes Select No space before ROM Select Use file name only without file extension See below Sample Command shows up as "FX3_Launcher_Classic.exe File" I removed AHK script data in the LB Running and Exit Tabs, since the launcher scipt now handles the key grabs. Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted August 23, 2020 Share Posted August 23, 2020 @tmreith Very well done!!! Thanks! Added to my cab and all is good! I do have to make one suggestion. Though very effective, Process, Close is not recommended for closing emulators. The "nice" way to do it is to use WinClose. $Esc:: WinClose, ahk_exe Pinball FX3.exe ExitApp return For lack of a better analogy, it's like giving it a strong sedative before pulling the plug rather than just shooting it between the eyes. (Ya, OK.. Been watching too many crime dramas. lol) Quote Link to comment Share on other sites More sharing options...
tmreith Posted August 24, 2020 Author Share Posted August 24, 2020 @JoeViking245 Thanks for the suggestion. Agree with the preference of WinClose over Process. NOTE: The shot to the head between the eyes was intentional - due to the frustration levels to get FX3 to work within LB/BB. ☠️ Since FX3 cabinet mode supports [ALT][F4] to exit, I gave the following a go and it works too! Maybe this is the best way out?? ;FX3_Launcher_Classic.EXE SCRIPT - Pinball FX3 ;Use ESC from keyboard or XBOX Guide Button to exit FX3 #SingleInstance, Force Run, "c:\steam\Steam.exe" -applaunch 442120 -class -table_"%1%" #IfWinActive ahk_exe Pinball FX3.exe SendMode, Input $Esc:: Send, !{F4} ExitApp return $vk07:: Send, !{F4} ExitApp return Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted August 24, 2020 Share Posted August 24, 2020 2 hours ago, tmreith said: due to the frustration levels I totally get it! lol Alt+F4 is just as "nice" as WinClose is. (Difference being some technical jargon about WM_CLOSE vs WM_SYSCOMMAND-SC_CLOSE. More than I really care to learn about! lol) And since there's #IfWinActive, there shouldn't be any mishaps if focus is lost (which shouldn't happen beyond the cat on the keyboard or the kids on the cab ). Quote Link to comment Share on other sites More sharing options...
sundogak Posted August 25, 2020 Share Posted August 25, 2020 (edited) Interesting. My setup works fine with this code in the Running Autohotkey Script tab for FX3. I used to use an AHK launcher exe but dispensed with that to try to keep things simple (or at least simpler). ; Use normal ALT f4 in windows to close. ESC takes back in menu. Esc:: Send, !{F4} return Also my game controller mapping in LB in Options for exiting works as well, so removed any AHK code I used to have for the Xbox One Guide button. Edited August 25, 2020 by sundogak note about controller Quote Link to comment Share on other sites More sharing options...
tmreith Posted August 25, 2020 Author Share Posted August 25, 2020 @sundogak the only difference in our settings appears to be that you have checked Attempt to hide console window on startup/shutdown and that your Steam/FX3 install is in the default location. (my install is at the root E: drive) For some reason on my cabinet FX3 ignores what ever I put in the Running AutoHotKeyScript. FX3 immediately goes to the FX3 pause screen and I have to navigate through the menus to exit. If I use my keyboard and press ALT F4, FX3 will exit. Although if ESC is pressed, the LB/BB Run AHK does not intercept. I also have ReDream on my cabinet, which uses ALT F4 to exit. ReDream works well with LB/BB with the same Running AutoHotKeyScript. I prefer a more streamlined solution without having to use a launch script. Is there anything else that may be different??? I am willing to find the root cause and ideal solution. Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted August 25, 2020 Share Posted August 25, 2020 My FX3 seemed to ignore the running AHK script as well. I tried it with $Esc and also just plain Esc. Tried using Pinball FX3 as the executable (which just creates a popup from Steam saying something like "this is weird, you sure you want to run with this command line?". Threw in some If WinActive type things too... All of which still put it into 'Pause' when pressing Escape. Another test I did try was having a script 'Esc...Send...ExitApp... in the Additional App - Run before (on a single game) and that did work to close FX3. (AHK full install required [or a compiled script]) In an old post here on the forums there was talk about different (eh hem..) versions/copies of the FX3 executable and also setting autohotkey.exe to run as administrator. My executable is straight from Steam with my one free game. I just now tried again setting it up the proper way as @sundogak shows [and had previously attempted]. 1st attempt, no joy. 2nd attempt, I set the AutoHotkey.exe under ../ThirdParty/...... to run as admin and got an error saying the game needed to ran elevated. 3rd attempt, unchecked Run As Admin from test 2, loaded the game, pressed Escape and it closed the game. ??????????????????????????????????? Yes. It is working like it's supposed to now. Steam.exe as the executable and 3-lines in the Running AutoHotkey Script tab. I have no idea if it was from setting/un-setting run-as-admin or what?????? Maybe it just needed a little of that sundogak Mo Jo. lol Not gonna question. Not gonna complain. Quote Link to comment Share on other sites More sharing options...
sundogak Posted August 25, 2020 Share Posted August 25, 2020 @tmreith The attempt to hide console option really shouldn't have any impact either way on the AHK side, so doubt that is the difference. But I have found the AHK code in the Running Autohotkey script tab can be "weird" sometimes in what works and doesn't versus an external code exe. Before the LB improvement in the Game Controller Mappings and adding in Pause feature I had very similar setup to you. However, once LB added in improved Game Controller Mapping and the Pause Menu feature I have had less issues with controller exit commands versus AHK. Anyway, have you tried deleting the Guide portion and just mapping the exit to Button 11 within LB? Then just using only the ESC AHK script portion? I would try completely erasing everything in the AHK tab (select all) and closing then adding in text from say notepad. I suspect there may be times where an errant space/character in the tab is causing issues with LB, but just a theory. Other than that, I am not much help since "should" work and I don't see anything obvious on why it wouldn't in your setup. So may be one of those "stick with what works" if the AHK exe is working for you. Quote Link to comment Share on other sites More sharing options...
tmreith Posted August 25, 2020 Author Share Posted August 25, 2020 @sundogak and @JoeViking245 thanks for the discussion. It is helpful to understand LB/BB more in detail. I am running the latest version of LB/BB. I'll take a look at my mappings. Maybe something has changed from a previous upgrade. My primary control is a Ultimarc I-PAC2 tied to respective HAPP arcade controls. I navigate LB/BB with the arcade controls. I only use my Xbox controller for console games. Pinball and Mame are through the arcade controls. For now.....I am going to stick with what works for now. 1 Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted August 25, 2020 Share Posted August 25, 2020 @tmreith Yup! If it ain't broke, don't "fix it". Your cab layout looks similar to mine except for the 3rd joy and you have a lot more buttons (8 vs 6 per player and more across the top). Looks very nice!! Are the 3 above the trackball setup as mouse buttons? Also, is that a dial I see on there too? Man! You got all sorts of goodies available there. Dang, mine looks so 'ordinary' now. lol Nice cab!!! Quote Link to comment Share on other sites More sharing options...
tmreith Posted August 25, 2020 Author Share Posted August 25, 2020 It's a terrible addiction!!! The 4-way joystick is configured for pac-man, dig-dug, etc with a 4-way restrictor. The 3 red buttons are in parallel with player 1 (1,2,3 buttons) - ideal for missile command, centipede, donkey kong, etc. The spinner is to the right for Tempest, Arknoid, driving games, etc. The top illuminated buttons are player 1/player 2 credit/start and MAME controls yellow=pause, green=enter, blue=tab, and red=esc Side buttons are for pinball - left/right flippers and left/right magna-save The coin-door is illuminated and works too - takes tokens I also setup a power relay that senses the 12vdc from the PC to switch on/off the audio amp, monitor, led lights, and fans. The switch is a momentary switch that ties to the PC power up pins on the mother board. Below are my Thingiverse designs - feel free to download U-Trak Arcade Trackball LED Illumination https://www.thingiverse.com/thing:4369759 Zippyy Classic Joystick 4 Way Restrictor Plate https://www.thingiverse.com/thing:3898688 Arcade Power Button Sleeve Adapter https://www.thingiverse.com/thing:4001913 1 Quote Link to comment Share on other sites More sharing options...
AceEsCloud Posted April 2, 2023 Share Posted April 2, 2023 On 8/23/2020 at 12:30 PM, tmreith said: SOLVED Required AutoHotKey executable script to launch FX3 to see ESC key to exit. I placed the FX3_Launcher_Classic.exe in the Stem root directory. Below is the AHK script. This needs to be compiled on your system - RIGHT click and select Compile Script to create EXE. I had to install AutoHotKey on my system to compile script. https://www.autohotkey.com/ ;FX3_Launcher_Classic.EXE SCRIPT - Pinball FX3 ;Use ESC from keyboard to exit FX3. #SingleInstance, Force Run, "e:\steam\Steam.exe" -applaunch 442120 -class -table_"%1%" #IfWinActive ahk_exe Pinball FX3.exe SendMode, Input $Esc:: Process, Close, Pinball FX3.exe ExitApp return $vk07:: Process, Close, Pinball FX3.exe ExitApp return Emulator settings for Pinball FX3: Set the Emulator Application Path to wherever your "FX3_Launcher_Classic.exe" is. For Default Command-Line Parameters NONE Or for FX3 Classic Table add "-applaunch 442120 -class -table_" - NOTE the "-class" before table Select Don't use quotes Select No space before ROM Select Use file name only without file extension See below Sample Command shows up as "FX3_Launcher_Classic.exe File" I removed AHK script data in the LB Running and Exit Tabs, since the launcher scipt now handles the key grabs. Thank you for this Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.