Main > Main Forum
Autohotkey + mame + win 7 x64 = SOLVED!
severdhed:
I have an Autohotkey script that it's designed so that when you press a certain key quickly, it sends one key press, but if you hold it for 3 seconds, it sends a different one. This is soi can use a single button for pause and exit. This worked perfectly fine on my old showcase cabinet (win xp) and my upright cabinet (win xp), but will not work on my new cabinet (win 7 64 bit). It is the same script, exact same version of mame( I copied the mame folder from the old cab to the new one). The script works fine outside of mame. It will not work :/ Terri different Windows 7 computers, but yet works on my Windows 8 laptop. Any ideas
severdhed:
it is really weird how this is works. The script works fine in notepad, but mame just seems to ignore it entirely. If i launch mame, and then alt-tab back to the desktop and press the key, it closes the mame executable. i just dont understand why it would work in xp and windows 8, but not windows 7. I just tested it here on my work pc, which is also windows 7, but it still does not function.
i have two versions of the script, one which sends either the P or Esc command when escape key is either held or pressed, and other which is set to send the p key if p is pressed, or process close mame.exe if it is held....neither work in mame. with the first one, mame exits immediately if esc is held or pressed. with the second one, it pauses when p is pressed, but nothing happens when held. if i alt-tab to the desktop with mame minimized, and hold the p key, it will close the mame executable like it should...just not while it is running.
is there something i'm doing wrong?
here are my scripts: ( i didn't write these, WXFORECASTER here on the forums created the first one for me years ago, i modified it for the second one.
/*
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 := "esc" ;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
HERE IS THE SECOND SCRIPT:
/*
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 := "p" ;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
{
Process, Close, mame.exe
if (exitScript = 1)
ExitApp
}
else
{
send {Blind} {%pauseKey% downtemp} ;Send MAME pause/unpause
send {Blind} {%pauseKey% up}
}
return
severdhed:
Ok, so i guess i was wrong. I thought for sure that i had it working on my windows 8 64bit machine, but i tested again and it does not work at all with mame, but is fine outside of it. i know when i did this the first time, i had to recompile mame to use directinput instead of rawinput or something like that. (which i did and it worked fine) do i need to recompile this on a 64bit system? is there something different with directinput in a 64bit os?
i'm running out of ideas. i could just install xp on the cabinet, but mk9 on steam doesn't support windows xp, which is something i'd really like to have on this cabinet.
SgtSlaughter:
Just throwing this out there... Have you tried running under compatibility mode? Or run mame as an administrator.
Also make sure filter keys is not enabled... http://windows.microsoft.com/en-ca/windows7/make-the-keyboard-easier-to-use
severdhed:
i tried run as administrator, and compatibility mode for xp sp3, but it still does not work with mame. i made sure filter keys were not enabled.
just for S&Gs, i found an old xp laptop, copied my mame folder and autohotkey scripts to it. installed autohotkey (from the same download i used on the windows 7 pc) and tried it, it worked just fine. It almost has to be something different with directinput in xp vs windows 7. This is related to which version of directx is installed, correct?
do i maybe need to try a newer version of mame? or an older one? i am running mame 124 right now, i'd like to stick with that if possible, since that is the romset i currently have.
i recompiled mame on my windows 7 pc, still no difference. i dont know if compiling a 64bit version would help or not, i'm not sure how to do that with this old version of mame.
Navigation
[0] Message Index
[#] Next page
Go to full version