New information. Took a break from the AHK thing and did a fresh install of Mala 174. Testing as I went along, exiting, launching MaLa and playing Donpachi (US) after any change and checking for the problem. Keeping everything as stock as possible, layout, sounds, etc. Mame 145, all newly DL'd catver.ini, controls.ini, etc. No plugins, no focus logger, etc. and no problem so far.
Then I installed the startcom plugin. Problem showed up right away. I think there is something happening between startcom and the usb joystick. My startcom plugin is set to run a batch file and pass it a variable for horizontal or vertical. the batch file calls the Pololu software SMCCMD via command line, 2 different ones according to the direction of rotation. The Pololu motor controller interfaces via USB.
Anybody else running a u360 and Mala with Startcom? My best bet is to get Nitz's ahk script running to change the usb joystick inputs to keypresses, but no luck so far - need help on this. Besides the script as shown in the previous post, I tried putting brackets around everything after #ifwinactive, and also tried DetectHiddenWindow since MaLa could be a hidden window? Never shows a window on screen. I'm past my depth on AHK at this point.
_____________________________________________________________
Update: Got it working with the final version below. I left out a hash mark that Nitz told me to do in front of ifwinactive, and I left out a #persistent that AHK told me to put in. I guess I'm not the best at following written directions sometimes. not sure if the detect hidden windows is needed, but now that it works I'm not going to experiment further!. Although I may work on a script to get MaLa to accept more than one key to start a game. E. g. mala currently allows only one keypress as the signal to start a game, I would like for coin up, p1 start, p2 start and fire button to all start a game. why make it hard for guests.
;
;This script is to make the joystick (u360) give keyboard inputs to MaLa, due to the problem with MaLa taking joystick inputs after the game starts and moving around in the gamelist when Mala would normally be asleep.
;
setTitleMatchMode, 2
DetectHiddenWindows,on
#IfWinActive, MaLa
#Persistent
SetTimer, WatchAxis, 5
return
WatchAxis:
GetKeyState, JoyX, JoyX ; Get position of X axis.
GetKeyState, JoyY, JoyY ; Get position of Y axis.
KeyToHoldDownPrev = %KeyToHoldDown% ; Prev now holds the key that was down before (if any).
if JoyX > 70
KeyToHoldDown = Right
else if JoyX < 30
KeyToHoldDown = Left
else if JoyY > 70
KeyToHoldDown = Down
else if JoyY < 30
KeyToHoldDown = Up
else
KeyToHoldDown =
if KeyToHoldDown = %KeyToHoldDownPrev% ; The correct key is already down (or no key is needed).
return ; Do nothing.
; Otherwise, release the previous key and press down the new key:
SetKeyDelay -1 ; Avoid delays between keystrokes.
if KeyToHoldDownPrev ; There is a previous key to release.
Send, {%KeyToHoldDownPrev% up} ; Release it.
if KeyToHoldDown ; There is a key to press down.
Send, {%KeyToHoldDown% down} ; Press it down.
return