Soomin papa Posted December 10, 2021 Share Posted December 10, 2021 I googled and found a suitable hotkey script for a standalone emulator. Through it, I was able to apply functions such as save, load, and quit the emulator by combining the select button and other buttons in xbox 360 pad mode. What I want is for the hotkey to work when another button is pressed while the select button is pressed, and most of them work the way I want them to. However, when the select button and the RT button or LT button are combined, the action of pressing the trigger button while the select button is pressed has no response. Conversely, pressing the select button while pressing the trigger button reacted. What I want to do is to do the sequence of pressing the trigger button while the select button is pressed. I want to create a motion that moves to the next save slot with the Select+RT button combination and the previous save slot with the Select+LT button combination. Attached here is the ahk script I got from Googling. I applied this script to the pcsx2 emulator and it helped me to make the hotkey work. Here, I would like to modify the operation order of the select button and trigger button as I want. Joy5:: Joy6:: Joy7:: { GetKeyState, SelectButton, Joy7 GetKeyState, L1Button, Joy5 GetKeyState, R1Button, Joy6 GetKeyState JoyZButtons, JoyZ JoyZButtons := Round(JoyZButtons) if (SelectButton = "D") { if (L1Button = "D") { ; Load state SendInput {F3} } else if (R1Button = "D") { ; Save state SendInput {F1} } else if (JoyZButtons > 60) { ; Prev slot SendInput !{F2} } else if (JoyZButtons < 40) { ; Next slot SendInput {F2} } } } Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted December 10, 2021 Share Posted December 10, 2021 11 hours ago, Soomin papa said: What I want to do is to do the sequence of pressing the trigger button while the select button is pressed. Z-triggers are an animal of their own and require special attention. It probably could be cleaned up a bit, but I think this gives you what you're trying to do. Joy5:: Joy6:: Joy7:: Press= SetTimer, WatchAxis, 5 return WatchAxis: { GetKeyState, SelectButton, Joy7 GetKeyState, L1Button, Joy5 GetKeyState, R1Button, Joy6 GetKeyState JoyZButtons, JoyZ JoyZButtons := Round(JoyZButtons) PressPrev= %Press% if (SelectButton = "D") { if (L1Button = "D") { ; Load state Press=L1 if Press= %PressPrev% return SendInput {F3} Sleep 750 } else if (R1Button = "D") { ; Save state Press=R1 if Press= %PressPrev% return SendInput {F1} Sleep 750 } else if (JoyZButtons > 60) { ; Prev slot Press=LZ if Press= %PressPrev% return SendInput !{F2} Sleep 750 Press= } else if (JoyZButtons < 40) { ; Next slot Press=RZ if Press= %PressPrev% return SendInput {F2} Sleep 750 Press= } } } Quote Link to comment Share on other sites More sharing options...
Soomin papa Posted December 10, 2021 Author Share Posted December 10, 2021 (edited) Thank you very much, JoeViking245. You saved me. 😀 I modified the script you made and succeeded in working as I wanted. I put my script here for anyone who needs it. Joy5:: Joy6:: Joy7:: Joy8:: Press= SetTimer, WatchAxis, 5 return WatchAxis: { GetKeyState, SelectButton, Joy7 GetKeyState, StartButton, Joy8 GetKeyState, L1Button, Joy5 GetKeyState, R1Button, Joy6 GetKeyState JoyZButtons, JoyZ JoyZButtons := Round(JoyZButtons) PressPrev= %Press% PressNext= %Press% if (SelectButton = "D") { if (L1Button = "D") { ; Load state SendInput {F3} Sleep 750 } else if (R1Button = "D") { ; Save state SendInput {F1} Sleep 750 } else if (JoyZButtons > 60) { ; Prev slot Press=LZ if Press= %PressPrev% return SendInput, {Shift down}{F2 down} Sleep 750 SendInput, {F2 up}{Shift up} Press= } else if (JoyZButtons < 40) { ; Next slot Press=RZ if Press= %PressNext% return SendInput {F2} Sleep 750 Press= } else if (StartButton = "D") { ; This section closes PCSX2 when pressing Escape WinClose, ahk_exe {{{StartupEXE}}} } } } Edited December 10, 2021 by Soomin papa 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.