Crush Posted February 24, 2017 Share Posted February 24, 2017 (edited) I was looking for a way to display some info - mainly easily forgotten key combinations - while playing games with WinUAE through Launchbox. WinUAE is using rawinput so it can't accept directinput commands from Autohotkey. Searching through the http://eab.abime.net i came upon a script which uses the WinUAE Pipe to get events from Autohotkey. I modified the script so when i press button 16 on my 4th gamepad, WinUAE goes into window mode, a message is displayed with some helpful info and waits for me to press OK (the game is still running normally in the background). Pressing OK makes WinUAE to revert to fullscreen mode. If you want to modify the script to send different events to WinUAE, all the events WinUAE accepts are listed here: https://github.com/tonioni/WinUAE/blob/master/inputevents.def #NoEnv ;Display Help Info #IfWinActive, ahk_Exe WinUAE64.exe4joy16:: WinUAE("EVT SPC_TOGGLEFULLSCREEN 1") MsgBox,,INFO,Use END+(1 to 0) to swap disks WinUAE("EVT SPC_TOGGLEFULLSCREEN 1") return #IfWinActive WinUAE(command) { VarSetCapacity(result, 4096) if !DllCall("CallNamedPipe", "str", "\\.\pipe\WinUAE" , "astr", command, "int", StrPut(command, "cp0") , "ptr", &result, "int", 4096 , "uint*", bytesRead, "uint", 1) throw Exception("CallNamedPipe failed with error " A_LastError) return RegExReplace(StrGet(&result, bytesRead, "cp0"), "\R$") } NOTE: I use WinUAE64. If you use the 32-bit WinUAE you must change the second line to read #IfWinActive, ahk_Exe WinUAE.exe Edited February 24, 2017 by Crush 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.