The NEW Build Your Own Arcade Controls
Front End Support => MaLa Frontend => Topic started by: kaptainsteve on April 20, 2014, 08:06:11 pm
-
Hello,
In Maximus Arcade they have a delay that can be assigned to a button.
For example, I put a 3 second delay on P2 so this way the P2 button has 2 separate functions; one as "#2" (no delay, immediate) and the other as "escape" (if held down for 3 seconds). The reason I do this is that I don't have enough buttons on the control panel to dedicate one for just escape and I use I-Pac. I-Pac normally has a shift button where if you press P1 & P2 together, it serves as the escape key/button. But, this cause too many errors and crashes and accidental escape pushes during games.
Is there a way to assign a delay to a button in Mala, which I prefer?
Thanks.
Steve
-
I don't know if there is a way to assign a delay in Mala directly as you describe, however, Mala can be programmed to allow for a wide variety of 2-button combos to work as ESC.
I know this isn't exactly the answer you were looking for. Not much of a difference from the option you already have, but maybe the difference is that you will likely be able to choose which two buttons Mala will use as Escape.
I too, don't have an extra button for Escape on my control panel (currently using an X-Arcade dual tankstick). I programmed Mala to enter ESC if #2 (P2) and the lower right pinball button are pressed at the same time.
The second option I'd suggest if you must have a delay is to use Auto Hot Key Script with Mala. I'm only a novice with AHK but I believe you could program a delay to any button you wanted and then have it send ESC if held for a certain amount of time:
http://www.autohotkey.com/docs/commands/SetKeyDelay.htm (http://www.autohotkey.com/docs/commands/SetKeyDelay.htm)
-
You can take a look to my program AllInOneFYC (http://forum.arcadecontrols.com/index.php/topic,134959.0.html).
Perhaps, It can be interesting for you.
Greetings!
-
You can do it with autohotkey.
Here's how sevredhed explained how to do it:
at the bottom of this post is the content of the ahk file. the key to getting this to work is that the button you are pressing has to be mapped to a different key than both your pause and exit keys. for instance, i use the default mame keys for pause (p) and exit (esc) i tried it with my button mapped to the P key on my encoder, but it did not work properly. i found that in order for it to work, i changed my button to be mapped to the PgDn key, which was unused for anything else. This way if i press PgDn quickly, it sends "p" or if i hold it for around 3 seconds, it sends "esc". this works very well.
no in order for this to function, mame has to be compiled to support direct input...by default, the newer versions do not. There are tutorials on how to do that around here somewhere if you don't know how. (i always compile my own anyway because i wanted the hi score, no nag patch) if you need help with this, let me know and I'll find the instructions i used.
here is the script. you can redefine the keys as you see fit. I cannot take credit for the script, it was created by forum user WXFORECASTER. everything below this line needs saved as an .ahk file:
/*
AUTHOR: WXFORECASTER 10/12/10
DESCRIPTION: DESIGN OVERRIDE SUCH THAT A SINGLE KEY PRESS AND KEY HOLD
GENERATE DIFFERENT FUNCTIONALITY
*/
/*
BEGIN HOLDESCAPE CODE
SET USER DEFINED VARIABLES BELOW
*/
timeToExit := 1.6 ;time in seconds key must be pressed before sending exit (this can be a decimal e.g. 1.5)
emulateKey := "PgUp" ;the key we are pressing/emulating
pauseKey :="p" ;your MAME pause key
exitKey := "esc" ;your MAME exit key
exitScript := 0 ;0= leave script running, 1= close script when the MAME exit key is fired,
;Make it so the following code only works if MAME is the active window
;#IfWinActive ahk_class MAME
;Establish Hotkey Mapping based on the emulate key above and trigger a chunk of code below (lblPauseExit)
Hotkey, $%emulateKey%, lblPauseExit
return
lblPauseExit:
KeyWait %emulateKey%, T%timeToExit%
if ErrorLevel = 1 ;timeout was reached...exit MAME
{
send {Blind} {%exitKey% downtemp} ;Send MAME Exit
send {Blind} {%exitKey% up}
if (exitScript = 1)
ExitApp
}
else
{
send {Blind} {%pauseKey% downtemp} ;Send MAME pause/unpause
send {Blind} {%pauseKey% up}
}
return
-
empardopo;
Thanks for the suggestion and your software.
I installed it, but still ran into some problems.
I'm using a Xin-Mo encoder (usb-gamepad-type) and I couldn't seem to get the Allforonefyc to recognize some of the buttons.
I'm using (for the moment) Mala as a frontend, with a few emulators like Mame, NES, SNES, AdvancedBoy and Project 64.
One problem I had w/Project 64 was that I couldn't assign and escape key between the combo of the Xin-Mo encoder and Project 64. The reason is that Project 64 won't recognize the Xin-mo for escape. So I used your software (AllInOneFYC) and assigned a kill process to Project64 w/it. That seems to work fine although I can't get the delay to work? No matter what you set the delay at, 3000 or 9000 milliseconds, it seems like the Xin-Mo gamepad type encoder doesn't recognize it and just immediately escapes. There were some other issues as well for instance I couldn't get the AllInOneFYC to recognize the button I wanted (2Joy6) for the kill process? I will eventually just put a mini-button between P1 and P2 on the control panel and dedicate it solely for the escape button for all emulators. So I use your program, the AllInOneFYC solely for the escape function of Project64. I wanted and tried to use it to reassign all the keys but ran into lots of difficulties.
When I tried to set up the AllInOneFYC with mame alone and couldn't get it to work, again, the problem is the AllInOneFYC, Xin-Mo encoder, and Mame just don't jell. I think what's going on is that Mame somehow overides the settings of both the encoder and the AllInOneFYC?
Anyway, thanks for the suggestion and the software.
I'll let you know more a bit later and as i work through this thing.
Thanks.
Steve
-
When I tried to set up the AllInOneFYC with mame alone and couldn't get it to work, again, the problem is the AllInOneFYC, Xin-Mo encoder, and Mame just don't jell. I think what's going on is that Mame somehow overides the settings of both the encoder and the AllInOneFYC?
MAME doesn't accept fake keypresses from software running in the windows environment.
It get's it's input further upstream, closer to the source.
Just remap "Cancel" in MAME to the button you want to use to exit it.
It's in the menu you get to by pressing TAB while MAME is running.
Go to Input:General, look for Cancel or UI Cancel.
I have an extra button on my x-arcade panel wired to the unused middle mouse button on the trackball harness.
MAME is remapped to use the middle mouse button instead of escape.
Everything else works from an autohotkey script posting ESC when the middle mouse button is pressed.
-
Just remap "Cancel" in MAME to the button you want to use to exit it.
It's in the menu you get to by pressing TAB while MAME is running.
Go to Input:General, look for Cancel or UI Cancel.
I have an extra button on my x-arcade panel wired to the unused middle mouse button on the trackball harness.
MAME is remapped to use the middle mouse button instead of escape.
Everything else works from an autohotkey script posting ESC when the middle mouse button is pressed.
Thanks, that's about what I have done. I previously installed an extra momentary mini-button in the control panel solely for escape. I also assigned cancel in mame to that key..
But, if you could, walk me through the whole process of assigning and getting AHK to work? I am in AHK clueless land.
In other words, how do you write an AHK script, where do you put it, and how to access it?
I also am using JoyToKey to assign reassign a letter to escape for one emulator that can only use 'esc.'
This is just a lot of stuff to do to get 'esc' to work on all emulators. I think it would be great if Mala would just put a delay, as in Maximus Arcade, in their software and save many users tons of aggravation. This way you just put a 3 second delay on your P2 button for escape.
Thanks.