Build Your Own Arcade Controls Forum
Main => Software Forum => Topic started by: Wade007 on July 15, 2012, 08:46:35 pm
-
I'm using an AHK script to launch a PC Game (Big Buck Hunter) on my cabinet.
After playing the game I can exit out two ways; by pressing ESC or by presing my combo two buttons AHK keys (2 + 4) at the same time. Both work to exit, but the latter somehow sets up Mala to not look right upon return.
If I press ESC, everything jumps back to the Mala frontend screen and menu like it's supposed to. Looks fine, works fine.
If I press 2 + 4, it goes back to Mala but the Mala screen and menu layout is somewhat jumbled up - the background is pushed into and past the lower right hand corner while the game screenshot and one other graphic overlay remain where they are suppose to be. It's like there wasn't a proper switch of resolutions back to my desktop resolution for Mala to get reset on the layout correctly. The menu system still works, but it doesn't look pretty.
Why is this happening with the two button exit only and more importantly, how can if fix it?? Thanks in advance for any help.
See below for my AHK code:
#SingleInstance force
SetWorkingDir, C:\Arcade\PC Arcade Ports\Big Buck Hunter\BBH2
Run, C:\Arcade\PC Arcade Ports\Big Buck Hunter\BBH2\BBH2.exe
WinWait, BBHSC
WinWaitClose, BBHSC
exitAPP
LCtrl::~LButton
LAlt::~RButton
c::~ESC
a::~LButton
s::~RButton
]::~ESC
~2 & ~4::
Process, Close, BBH2.exe
ExitAPP
return
-
There is an option in Mala to re-order the layout, but not sure if that would help in this situation.
Autohotkey cures all though. ;D
Copied from one of my scripts, but originally swiped from here:
http://www.autohotkey.com/community/viewtopic.php?f=2&t=8355&start=30 (http://www.autohotkey.com/community/viewtopic.php?f=2&t=8355&start=30)
Just change the resolution settings to match your desktop.
#SingleInstance force
SetWorkingDir, C:\Arcade\PC Arcade Ports\Big Buck Hunter\BBH2
Run, C:\Arcade\PC Arcade Ports\Big Buck Hunter\BBH2\BBH2.exe
WinWait, BBHSC
WinWaitClose, BBHSC
exitAPP
LCtrl::~LButton
LAlt::~RButton
c::~ESC
a::~LButton
s::~RButton
]::~ESC
~2 & ~4::
Process, Close, BBH2.exe
cD = 32 ; bits (quality) - you can change to suit your requirments
sW = 1920 ; pixels - you can change to suit your requirments
sH = 1080 ; pixels - you can change to suit your requirments
rR = 60 ; Hz (frequency) - you can change to suit your requirments
ChangeDisplaySettings( cD, sW, sH, rR )
ExitAPP
Return
ChangeDisplaySettings( cD, sW, sH, rR ) {
VarSetCapacity(dM,156,0), NumPut(156,dM,36)
DllCall( "EnumDisplaySettingsA", UInt,0, UInt,-1, UInt,&dM ), NumPut(0x5c0000,dM,40)
NumPut(cD,dM,104), NumPut(sW,dM,108), NumPut(sH,dM,112), NumPut(rR,dM,120)
Return DllCall( "ChangeDisplaySettingsA", UInt,&dM, UInt,0 )
}
-
Sweet. I like it. Thanks badmouth! ! :applaud:
Another quick fix was just to map the whole two button exit to the ESCAPE key instead of the close process command:
~2 & ~4:: Send input {ESC}
ExitAPP
return
-
Hey guys,
I want to use the method badmouth describes below to change resolutions back to desktop settings so mala doesn't get all disordered when I close a process with autohotkey. However, I'm using arcade VGA and a multisync arcade monitor and I'm not sure what my true desktop resolution is and don't trust the windows display settings say. Is there a program that will tell me exactly what my desktop resolution is? Sorry if this is a dumb question.
-
I think the problem is to kill the process.
Take a look to my program AllInOneFYC.
Greetings.
Enviado desde mi GT-N7100 usando Tapatalk 2
-
Yeah, the allinonefyc looks pretty handy. Does the close process function on your program reset the resolution? I can close process with autohotkey but the problem is that mala looks very odd when I close process out of mame.
-
Hey guys,
I want to use the method badmouth describes below to change resolutions back to desktop settings so mala doesn't get all disordered when I close a process with autohotkey. However, I'm using arcade VGA and a multisync arcade monitor and I'm not sure what my true desktop resolution is and don't trust the windows display settings say. Is there a program that will tell me exactly what my desktop resolution is? Sorry if this is a dumb question.
Sorry, don't know much about arcade VGA.
You might try using the winclose command instead of process, close.
Instead of the exe name, it requires whatever is in the title bar.
WinClose, BBHSC
It's gentler than process close and might not screw up the resolution.
I'm not sure, I haven't tested it, but it's worth a shot.
-
Yeah, the allinonefyc looks pretty handy. Does the close process function on your program reset the resolution? I can close process with autohotkey but the problem is that mala looks very odd when I close process out of mame.
No.
What key closes your program? If, for example, ESC is the key that closes the program you can use the keyrempas section of AllInOneFYC.
In the section, WindowsResolution you can define a key or button to change the windows resolution.
You can see the AllInOneFYCs instructions in this thread (http://forum.arcadecontrols.com/index.php/topic,134959.msg1392649.html#msg1392649).
Greetings!
-
Badmouth, as usual you are the ahk master. Winclose worked like a charm, no mala disorder after closing the game. Thanks again for getting me out of yet another jam.
Empardopo, thank you for your help too. Your program looks great! If I didn't already have an ahk script running, I would have totally used your program. I'll give it a shot if I get into a jam in the future. Might not be a bad idea to add a "winclose" feature to compliment the process close cabability. That seemed to make a world of difference to the mala front end.
Cheers fellas!
-
Badmouth, as usual you are the ahk master.
Nitz is the AHK master. I'm just around more. :lol