JoeViking245 Posted October 6, 2020 Share Posted October 6, 2020 @monsterm90 It worked with Notepad. ? 1st of all found the correct executable name. ("PPSSPPWindows64.exe"?) But for some reason just sending Win+Shift+Left [in the script] isn't working for me. Even if I put that first Sleep for 10 seconds. Here's Joe's workaround for PPSSPP. (at least it seemed to work on mu computer) Loop { IfWinActive, ahk_exe PPSSPPWindows64.exe { Sleep, 2000 ;hang out a couple seconds Send, !{Enter} ;go to windowed mode ;Sleep, 1000 Send #+{Left} ;Send Win+Shift+Left ;Sleep, 1000 Send, !{Enter} ;go back to fullscreen ExitApp } } Part of it I'm thinking is because it's running in fullscreen. But once opened, you can press Win+Shift+Left and it works. What's worse is you can create a hotkey and THAT will work. Here it won't Loop (wait around), but if PPSSPP is the active window and you press "Q", it'll move it over. q:: { IfWinActive, ahk_exe PPSSPPWindows64.exe { Send #+{Left} ExitApp } } Quote Link to comment Share on other sites More sharing options...
Johno1980 Posted October 7, 2020 Share Posted October 7, 2020 @JoeViking245 Thanks again for your help and will have a go at the weekend cheers ? 1 Quote Link to comment Share on other sites More sharing options...
monsterm90 Posted October 7, 2020 Share Posted October 7, 2020 18 hours ago, JoeViking245 said: @monsterm90 It worked with Notepad. ? 1st of all found the correct executable name. ("PPSSPPWindows64.exe"?) But for some reason just sending Win+Shift+Left [in the script] isn't working for me. Even if I put that first Sleep for 10 seconds. Here's Joe's workaround for PPSSPP. (at least it seemed to work on mu computer) Loop { IfWinActive, ahk_exe PPSSPPWindows64.exe { Sleep, 2000 ;hang out a couple seconds Send, !{Enter} ;go to windowed mode ;Sleep, 1000 Send #+{Left} ;Send Win+Shift+Left ;Sleep, 1000 Send, !{Enter} ;go back to fullscreen ExitApp } } Part of it I'm thinking is because it's running in fullscreen. But once opened, you can press Win+Shift+Left and it works. What's worse is you can create a hotkey and THAT will work. Here it won't Loop (wait around), but if PPSSPP is the active window and you press "Q", it'll move it over. q:: { IfWinActive, ahk_exe PPSSPPWindows64.exe { Send #+{Left} ExitApp } } yes thanks! the 1st ahk codes is works for me! 1 Quote Link to comment Share on other sites More sharing options...
FR0NZ Posted October 11, 2020 Share Posted October 11, 2020 (edited) Do you know a script to hide the emulator window and the mouse cursor? Edited October 11, 2020 by FR0NZ Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted October 11, 2020 Share Posted October 11, 2020 If you haven't done so already, try 1st some of the build in features under Edit Emulator. 1 Quote Link to comment Share on other sites More sharing options...
modhack Posted October 19, 2020 Share Posted October 19, 2020 (edited) Hello, I'm looking for a script who can send a different action who depends how long you press the button if I press 1joy11 one time , it should send ^C if I press 1joy11 more than 2 sec , it should send ^v it's for CITRA Save & Load last state If it's not possible, how I can set script to say Joy7 + Joy11 (in the same time) send ^C Joy8 + Joy11 (in the same time) Send ^V Thanks for your help Edited October 19, 2020 by modhack Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted October 19, 2020 Share Posted October 19, 2020 1Joy11:: { KeyWait, Joy11, T2 ;long press ("T2" = Time 2 seconds) if (ErrorLevel) { Send ^V ;long press of 1Joy11 Sleep 500 } Else { Send ^C ;[short] press of 1Joy11 Return } } Or your Plan "B" 1Joy11:: If GetkeyState("Joy7") { Send ^C return } Else If GetkeyState("Joy8") { Send ^V return } With this one, you need to press Joy11 AFTER pressing and holding Joy7 or Joy8 respectively, in succession. Quote Link to comment Share on other sites More sharing options...
modhack Posted October 20, 2020 Share Posted October 20, 2020 (edited) Thanks joeVikings245 but I have no success with both scenario , it seems it save all the time (^c), impossible to reach the commande ^v [EDIT] OK I understand, I have another script to send ctrl+C when I press only joy11, I was not aware that it could make a conflict not sure Edited October 20, 2020 by modhack Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted October 20, 2020 Share Posted October 20, 2020 (edited) Ya, you want to setup only one set of hotkeys for the same button. Change the "C" and the "V" to lowercase "c" and "v" respectively in the code and see if that helps. You can also shorten the duration of the 'long key press' (if you want) because in this day-and-age two seconds can actually be a really long time. I just tested the 1st one [that uses the long-press] in Citra and it does work (at least here) for both save and load. (didn't verify the 2nd [combo button press] though) EDIT: Tested the combo button press using lower case "c" and "v" and it worked as well. Edited October 20, 2020 by JoeViking245 Quote Link to comment Share on other sites More sharing options...
modhack Posted October 20, 2020 Share Posted October 20, 2020 Thanks for the test, I'm afraid that I screwed up something because now even the script 1JOY11::Send ^c or 2JOY11::Send ^c don't work Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted October 20, 2020 Share Posted October 20, 2020 Did you change the hotkey assignment inside Citra to something else? Is there an old(er) AHK script by chance still running (as in one that was started outside of LB)? Pop the battery out of the controller(s). Shut everything down. Restart the PC, put the battery back in and try again from 'scratch'. Quote Link to comment Share on other sites More sharing options...
VoidTheWolf Posted October 23, 2020 Share Posted October 23, 2020 (edited) Hi All , I have search this thread for mentions of Keyboard2xintput AHK and found a few mentions but none to what im after or a mention to look in previous posts , i have and cant find anything, In a previous post i found a user mentions k2x comes with a sample ahk ive tried editing it to best of my knowledge but since i know nothing about coding im falling short. The Problem i am having is when i leave a game and return to bigbox my joysticks dont work because k2x is running if i turn k2x off they work. Apparently in the sample ahk provided you can load k2x when a steam game starts and when you exit it turns off ? im unable to get that to work Are you able to assign a button on your arcade to toggle k2s on and off what is my best options ? This is the sample AHK #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. Run, "E:\bartop\software\keyboard2Xinput\keyboard2XinputGui.exe" Run, "C:\Program Files (x86)\Steam\Steam.exe" -applaunch %1% isRunning := "0" While (isRunning = "0") ; Wait until the game is launched RegRead, isRunning, HKCU\Software\Valve\Steam\Apps\%1%, Running Sleep, 500 Sleep, 5000 MouseMove, 1920, 1200 WinGetTitle, Title While (isRunning = "1") ; Wait until the game is closed RegRead, isRunning, HKCU\Software\Valve\Steam\Apps\%1%, Running Sleep, 500 ; Game stopped, stop keyboard2Xinput by sending numpad multiply key (see k2x mapping.ini) SendInput {NumpadMult} ; change focus back to Attract-Mode WinActivate Attract-Mode What ive done is edit line "E:\bartop\software\keyboard2Xinput\keyboard2XinputGui.exe" to the correct directory then copied txt Then i went to launchbox - Tools - Edit Autohotkey scripts for Windows Games and Pasted it in there but when i launch a steam game it wont load k2s Any help would be much appreciated Edited October 23, 2020 by VoidTheWolf Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted October 23, 2020 Share Posted October 23, 2020 8 hours ago, VoidTheWolf said: Autohotkey scripts for Windows Games ... doesn't work for games that are launched via a Steam ID. Also, in your sample AHK script, the 2nd "Run" command is attempting to launch to Steam game. So in effect, if this did work, LaunchBox would run your script which loads K2X and launches the game, then LB itself would [also] launch the game. It looks like the script you show is designed to be ran as an Emulator. That is, compile the script [to an exe]. Then in LB, Add a New Emulator and point it to your compiled script. Then for your Steam games, tell it to use this 'new' emulator. Here's where a person smarter than myself needs to help.... you may need to edit the Application Path to the Steam game(s). Mine all say something like steam://rungameid/818320 From your 2nd Run command which uses a command line to launch the game, it may only want the Steam's game ID #. (v.s. the whole line shown above). So in my case Run, "C:\Program Files (x86)\Steam\Steam.exe" -applaunch %1% ;...would become.... Run, "C:\Program Files (x86)\Steam\Steam.exe" -applaunch steam://rungameid/818320 ;...but might need to be simply... Run, "C:\Program Files (x86)\Steam\Steam.exe" -applaunch 818320 To clarify, I'm not saying edit the script. I'm saying you may need to edit the Application Paths for the games. The compiled script with automatically change %1% to whatever is in the games Application Path. Be it "steam://rungameid/818320", or simply "818320". 1 Quote Link to comment Share on other sites More sharing options...
VoidTheWolf Posted October 23, 2020 Share Posted October 23, 2020 Thanks Heaps for replying JoeViking will give everything you mention a try and see how i go 1 Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted October 24, 2020 Share Posted October 24, 2020 @VoidTheWolf Being the person I am, I just had to test this. Short story, works GREAT! Granted I did NOT test with K2X or any secondary app/program, but the launching of a Steam game, waiting for it to exit/quit, then do something else does work. (tested using a simple message box) #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. Run, "E:\bartop\software\keyboard2Xinput\keyboard2XinputGui.exe" ;**** Verify Path **** Run, "C:\Program Files (x86)\Steam\Steam.exe" -applaunch %1% ;**** Verify Path **** isRunning := "0" While (isRunning = "0") ; Wait until the game is launched RegRead, isRunning, HKCU\Software\Valve\Steam\Apps\%1%, Running Sleep, 500 Sleep, 5000 MouseMove, 1920, 1200 WinGetTitle, Title While (isRunning = "1") ; Wait until the game is closed RegRead, isRunning, HKCU\Software\Valve\Steam\Apps\%1%, Running Sleep, 500 ; Game stopped, stop keyboard2Xinput by sending numpad multiply key (see k2x mapping.ini) ; MsgBox, Game Exited SendInput {NumpadMult} The last 2 lines that were in your code aren't necessary for LaunchBox. The 2nd to last line I have here was my test to verify that it indeed did wait until the game exited before continuing on. If your Steam games' Application Path uses the Steam's game ID such as "steam://rungameid/818320", that WILL work as is. So the only thing you'll need to do for the games is to have them use an emulator (the compiled script). When you add the new Emulator, be sure to CHECK both the "Don't use quotes" and the "Use file name only" boxes. I don't think the Quotes one actually matters, but the Use File Name Only definitely does. And of course, under Associated Platforms, add Steam. If ALL your Steam games will use K2X, check the box for Default Emulator. 1 Quote Link to comment Share on other sites More sharing options...
VoidTheWolf Posted October 24, 2020 Share Posted October 24, 2020 @JoeViking245 Thankyou so much for taking the time to test this out and post it going to do as you have mentioned above hope this helps future noobs with this problem aswell 1 Quote Link to comment Share on other sites More sharing options...
hodgegoulashi Posted October 25, 2020 Share Posted October 25, 2020 I didn't see anyone else having this issue so I wasn't sure if it was just me, but when opening a game with Nebula's Sega Model 2 emulator the window border was still visible. I added the following snippet to the "Running Autohotkey Script" tab for the emulator. This will maximize the window so a true full screen is shown. ; This section maximizes the game window on startup Sleep, 500 Send {LWin down} {Up} {LWin up} Return 1 Quote Link to comment Share on other sites More sharing options...
VoidTheWolf Posted October 25, 2020 Share Posted October 25, 2020 @JoeViking245 Finally got to test it today and worked 100% whoooo hoooo thanks heaps again For fellow Noobs Step 1. remove this code that @JoeViking245 added to test for me ; MsgBox, Game Exited Step 2. Edit this line "E:\bartop\software\keyboard2Xinput\keyboard2XinputGui.exe" and add your dir for k2x executable Step 3 . Install Autohotkey program it installs a program with it called .ahkto.exe run that and point to your notepad file with the ahk script , hit convert to .exe Step 4. Add as steam emulator as @JoeViking245 has guided above Hope ive simplified it even further for future noobs 1 Quote Link to comment Share on other sites More sharing options...
hodgegoulashi Posted October 26, 2020 Share Posted October 26, 2020 Once again sorry if this is around but I didn't see it when looking. I run Flycast standalone outside of Retroarch. In order for escape to work for exiting games you will need to use the following auto hotkey script. Note: this is this is just a copy and paste from the M2 emulator script but figured if I can make life easier for someone looking around might as well. Cheers all! ; This section closes Sega Model 2 Emulator when pressing Escape $Esc:: { Process, Close, {{{StartupEXE}}} } Quote Link to comment Share on other sites More sharing options...
Retro808 Posted October 26, 2020 Share Posted October 26, 2020 12 minutes ago, hodgegoulashi said: Once again sorry if this is around but I didn't see it when looking. I run Flycast standalone outside of Retroarch. In order for escape to work for exiting games you will need to use the following auto hotkey script. Note: this is this is just a copy and paste from the M2 emulator script but figured if I can make life easier for someone looking around might as well. Cheers all! ; This section closes Sega Model 2 Emulator when pressing Escape $Esc:: { Process, Close, {{{StartupEXE}}} } It been long recommended to no longer use Process, Close as it is a hard close script. The script below if better to use. I know by default LB puts the Process, Close script in a few emulators and I have asked Jason if we can update LB with the better code. ; This section closes emulator when pressing Escape $Esc:: { WinClose, ahk_exe {{{StartupEXE}}} } 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.