Jump to content
LaunchBox Community Forums

LaunchBox + MAME + Gun4IR + AHK Script Window Focus Issues


w00master

Recommended Posts

Hey Everyone-

I recently obtained a set of Gun4IR lightguns.  These things are so awesome and been having a blast getting my LightGuns setup.  That said, because I prefer playing on the actual aspect ratio (instead of stretched), I've been using an AHK script to dynamically adjust this when a MAME game launches.  The script does work in that the GUN4IR guns recognize the correct aspect ratio boundaries.  However, in MAME games I run into a focus issue.  Here's the AHK Script I'm using (note: I've also employed the script that removes the error/warning messages):

Run, %COMSPEC% /C echo M3.1 > COM4
Run, %COMSPEC% /C echo M3.1 > COM5

WinWait, ahk_exe {{{StartupEXE}}},,60
if ErrorLevel
    return

WinWaitActive,,,30
if ErrorLevel
     return

Sleep 2000
SetKeyDelay, 125, 50
Send, {space 3}

~ESC::
Run, %COMSPEC% /C echo M3.0 > COM4
Run, %COMSPEC% /C echo M3.0 > COM5
ExitApp
return

So again, technically this works - but I run in to 2 issues:

1.  When the game launches out of LaunchBox/BigBox - the MAME game window loses focus and I have to alt-tab over to the game

2.  When in the MAME game, when I go into configure controls (or whatever), whenever I hit Escape, instead of going back one step in MAME, the window - again - loses focus.  Strangely, this only happens once.  

Here's a screencast video of all of this happening: 

https://app.screencast.com/przDsPsSqgQB9

Just in case, I've done the same screencast without the script portion that removes some of the warning screens in MAME (still the same behavior):

https://app.screencast.com/wqNIQpyQZC03w 

Any help would be appreciated!

Edited by w00master
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...