at_the_arcade Posted January 11, 2023 Share Posted January 11, 2023 I have LB/BB running on an arcade cabinet. Today I added a Steam Game (PAC-MAN Championship Edition DX+) to my setup. You can't custom map controls inside the game itself from what I've seen but the game only uses a joystick and three buttons (Escape, Backspace, Enter). I created an AHK script to change my button 1 to Enter and my button 2 to Backspace so I can play the game, navigate menus, etc. It works great but the problem I have now is that the script continues to run when I exit the game. So my controls are incorrect for other games. I spent a couple of hours searching the forums, the AHK forums, watching Youtube tutorials, and trying things on my own and I can't seem to figure out the right way to get the script to exit when the game exits. Does anyone know how to do this properly? It seems I need to use the winwaitclose command but I must be doing something wrong because every variation of it I've tried has failed. Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted January 11, 2023 Share Posted January 11, 2023 Can you show what you've tried? Are you using a winwaitactive before your winwaitclose? Put in some "msgbox testing" before and after the waits to see when they trigger to determine what and where it's failing and hanging up. Quote Link to comment Share on other sites More sharing options...
at_the_arcade Posted January 11, 2023 Author Share Posted January 11, 2023 I don't have any copies of the scripts I've tried on hand. I just kept replacing code over and over again hoping something I found would work. I don't really know a whole lot about coding so I was just hoping someone had a working script I could use. Quote Link to comment Share on other sites More sharing options...
at_the_arcade Posted January 11, 2023 Author Share Posted January 11, 2023 Solved: if WinActive("PAC-MAN Championship Edition DX+") ; must be window name can use window spy to find this { h::Enter ; Remap h into enter y::Backspace ; Remap y into backspace } WinWaitClose, PAC-MAN Championship Edition DX+ ExitApp 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.