TheNewClassics Posted May 31, 2019 Share Posted May 31, 2019 I appreciate you troubleshooting it with me. It must be something with my setup, because I tried just taking out the script altogether to start. That will close the game window, but obviously the GUI window still remains. Every script I tried just causes the emu to essentially hang when I exit. At this point I almost need an extra script that would run a few seconds around the initial exit in order to close the GUI separately. Quote Link to comment Share on other sites More sharing options...
Retro808 Posted May 31, 2019 Share Posted May 31, 2019 6 minutes ago, TheNewClassics said: I appreciate you troubleshooting it with me. It must be something with my setup, because I tried just taking out the script altogether to start. That will close the game window, but obviously the GUI window still remains. Every script I tried just causes the emu to essentially hang when I exit. At this point I almost need an extra script that would run a few seconds around the initial exit in order to close the GUI separately. Are you running the nightly build or canary? Did you change any settings in Citra like the control HotKeys in the configuration? Is it just exiting to the GUI or also asking you to confirm exit? When you run a game through Launchbox and just hit Alt+F4 (or CTRL+Q) will it exit correctly? Quote Link to comment Share on other sites More sharing options...
TheNewClassics Posted May 31, 2019 Share Posted May 31, 2019 (edited) I'm using canary builds. Didn't touch any of the control hotkeys. Just exiting to the GUI, no confirmation. Just tried it with keyboard. Alt+F4 just freezes it; I took a look at the hotkeys you mentioned and it does say F4 can pause emulation. But the good news is that Ctrl+Q closes it perfectly. So I just need to put a script together for Ctrl+Q and I bet I'll be good to go. You're the man Retro! Would it just be Esc:: Send, ^q Edited May 31, 2019 by TheNewClassics Quote Link to comment Share on other sites More sharing options...
Retro808 Posted May 31, 2019 Share Posted May 31, 2019 Should work or just Esc:: Send ^q 1 Quote Link to comment Share on other sites More sharing options...
TheNewClassics Posted May 31, 2019 Share Posted May 31, 2019 Success. Thanks! FYI if anyone else happens to have this issue, Yuzu has the same hotkey for closing too. Quote Link to comment Share on other sites More sharing options...
drewjbx Posted June 3, 2019 Share Posted June 3, 2019 Hey all I'm finishing up my LB build.. coming from hyperspin I used xpadder for various PC games for button mapping but also exiting, like Alt+F4. The AHK scripting in LB is a nice feature. How can I add a exit AHK script to games that don't use an emulator... so I can map an exit button for PC games.. (or any executable without an emulator) Quote Link to comment Share on other sites More sharing options...
Retro808 Posted June 3, 2019 Share Posted June 3, 2019 8 hours ago, drewjbx said: Hey all I'm finishing up my LB build.. coming from hyperspin I used xpadder for various PC games for button mapping but also exiting, like Alt+F4. The AHK scripting in LB is a nice feature. How can I add a exit AHK script to games that don't use an emulator... so I can map an exit button for PC games.. (or any executable without an emulator) When you right click and edit a game there is an additional apps tab. You can launch an AHK on a per game basis there. Since you used xpadder I would also recommend Controller Companion. It is only $2.99 on Steam and works like xpadder. I know we have quite a few members and mods that use it with Launchbox. 1 1 Quote Link to comment Share on other sites More sharing options...
drewjbx Posted June 3, 2019 Share Posted June 3, 2019 Will give controller companion a go... haven't heard of it until now, thanks for the info! Quote Link to comment Share on other sites More sharing options...
drewjbx Posted June 3, 2019 Share Posted June 3, 2019 Anyone know if controller companion will work with joystick controls in a cab setup. Particularly xin-mo controllers…. or is this only for 360 gamepads. Quote Link to comment Share on other sites More sharing options...
avaris Posted June 5, 2019 Share Posted June 5, 2019 can anyone help me with a script i've been dealing with? 1joy5 & 1joy6:: Process, Exist, osk.exe if (ErrorLevel) { PostMessage, 0x112, 0xF060,,, ahk_exe osk.exe } else { Run, C:\Windows\System32\osk.exe } return This so far works, but only with 1joy5 and 1joy6 pressed at the same time, which is the shoulder buttons on my controller, how would i do this if i want shoulder buttons AND start + select? (1joy10, 1joy9) i tried "1joy5 & 1joy6 & 1joy10 & 1joy9::" and similar but doesn't work at all. Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted June 5, 2019 Share Posted June 5, 2019 Per https://www.autohotkey.com/docs/Hotkeys.htm Quote Combinations of three or more keys are not supported. This of course excludes modifiers (Alt, Ctrl, Win, Shift....). That being said, they continue on with something about GetKeyState. I was able to get a 3 key press to work. ("key" being a non-modifier, joy/mouse button...) #if GetKeyState("Z", "P") X & C::MsgBox X then C were pressed while holding Z. If while Z is pressed, X and then C are both pressed/held, post the message box. It seems like they need to be pressed (and held) in that order. Just change Z, X and C to your 1Joyx. If you have to have 4 buttons pressed, I'm sure there's a way to do an If-Then-While-Not-Get... overly complicated, brainiac way. Well, maybe not that bad. Quote Link to comment Share on other sites More sharing options...
JamesBond@ge Posted July 6, 2019 Share Posted July 6, 2019 On 6/3/2019 at 12:10 PM, Retro808 said: When you right click and edit a game there is an additional apps tab. You can launch an AHK on a per game basis there. Since you used xpadder I would also recommend Controller Companion. It is only $2.99 on Steam and works like xpadder. I know we have quite a few members and mods that use it with Launchbox. I can vouch for Controller Companion. I use Controller Companion and Xpadder together. Controller Companion is the only one of the two that can map buttons to the Xbox Guide Button. Like Alt+F4 for Citra and Cemu etc. Quote Link to comment Share on other sites More sharing options...
Retro808 Posted July 8, 2019 Share Posted July 8, 2019 Looking to the AHK gurus for some help. In need of an AHK that will: Delay 8 seconds then Send (Right Arrow Key) and then Send "6" after an exe opens. Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted July 9, 2019 Share Posted July 9, 2019 #j:: ;press Win+J to start Sleep, 8000 send, {right} Process,Wait,notepad.exe Sleep,1000 send, 6 return This assumes that when it ('notepad') opens, it has focus. If it's possible to be already open.... you'll want some more checks and balances in the code. The 2nd sleep is just a buffer to make sure 'notepad.exe' is fully there. Probably can be omitted, but a good safety net. You know. It's Windows and all. Line 1: Can be deleted if you don't need a hotkey. BTW, J is for JoeViking. ? Quote Link to comment Share on other sites More sharing options...
Retro808 Posted July 9, 2019 Share Posted July 9, 2019 Thanks @JoeViking245 I will give it a test later tonight. 1 Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted July 10, 2019 Share Posted July 10, 2019 So I re-read your post... I think this is more what you were actually asking for. Srry 'bout that. Process,Wait,notepad.exe ;wait here until 'my_program.exe' is running Sleep,8000 ;wait for 8 seconds WinActivate,ahk_exe notepad.exe ;set (make sure) my_program is the active window send,{right} ;press the right arrow key send,6 ;press the number 6 key (optional) Line 3 just makes sure that "Right" and "6" are being sent to the program we were waiting for. Just in case other programs take focus during the 8-sec pause. 2 Quote Link to comment Share on other sites More sharing options...
Retro808 Posted July 10, 2019 Share Posted July 10, 2019 Thanks @JoeViking245 Have not had a chance to test. Was hoping to be home the other night from a work trip. Will report back once I can. 1 Quote Link to comment Share on other sites More sharing options...
Retro808 Posted July 10, 2019 Share Posted July 10, 2019 @JoeViking245 Works well with a random miss, but I think it is just a timing tweak depending if I have things in the background running or not that delays the exe opening sometimes. Easy enough to change the wait time. Big thanks for this. Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted July 10, 2019 Share Posted July 10, 2019 You are very welcome. Ya, there really isn't a way (that I'm aware of) to 'know' if a program has completely loaded. It can only check that it's started/running. And like you said, load time can vary depending on what else is working in the background. But at least there's the catch to make sure it has focus so we're not sending keys to another program that may pop up while waiting. ...which makes line 3 a little less 'optional'. If 9000 (9 seconds) for sure works, you can always try to trim it down to 8500 or 8800 or 8602 or 8150... you get the picture. Hey, in this fast paced world why wait 9 seconds when we can get away with just 8.602 seconds. lol 1 Quote Link to comment Share on other sites More sharing options...
jayjay Posted July 11, 2019 Share Posted July 11, 2019 (edited) On 7/9/2019 at 12:24 AM, Retro808 said: Looking to the AHK gurus for some help. In need of an AHK that will: Delay 8 seconds then Send (Right Arrow Key) and then Send "6" after an exe opens. You could add a loop that checks if the window exists. Something like SetTitleMatchMode, 2 Loop { if WinExist("Untitled - Notepad") { WinActivate break } } send,{right} send,6 Im rusty on ahk, so you might have to play with it a little. But iv used something like this before, it does work. It should remove the need for sleep... maybe? Unless the window opens and then your waiting for it to load, then you would still need sleep. Ha. Edited July 11, 2019 by jayjay 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.