Game Controller 3 Button Question

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Hagenige
Posts: 1
Joined: 22 Feb 2019, 14:29

Game Controller 3 Button Question

22 Feb 2019, 15:51

Hi there, I've been trying to start learning AHK and i've gotten to a part that's causing me to pull my hair out.
I'm ok when it comes to making 2 button hotkeys with the joypad, but what I need is this... a 3 button joypad
hotkey where the order of those 3 key presses DOES matter.

Example: I need to Hold Joy 5, THEN Hold Joy6, and only THEN press Joy1 and release all. But I also need one
that is the reverse of that such that it Holds 6, THEN 5, then 1. Because of that, the order matters. Here is what I've
come up with so far, but none of it quite works. Thanks in advance for proving me the noob that I am and showing me
what i've done wrong.



Below are some of my attempts to get it working.


Joy1::
;This one Works
If GetKeyState("Joy5") & !GetKeyState("Joy6")
MsgBox, you pressed Joy1 while holding down Joy5!

;This one Works
Else if GetKeyState("Joy6") & !GetKeyState("Joy5")
MsgBox, you pressed Joy1 while holding down Joy6!

;This Works if 5 and 5 order does not matter.... But sadly it does
Else if GetKeyState("Joy5") & GetKeyState("Joy6")
MsgBox, you pressed Joy1 while holding down Joy5&Joy6

;But what I need is two for when order DOES matter
;i.e. Key presses need to be Hold Joy 5, Then Hold Joy6, Then press Joy1
;i.e. Key presses need to be Hold Joy 6, Then Hold Joy5, Then press Joy1


Return




;Below are a Few things I've Tried.





;This one Fires off even without pressing Joy6
Joy6 & Joy1::
If GetKeyState("Joy5")
MsgBox, Held Joy 5, Then Held Joy6, Then pressed Joy1!
Return



;This one Fires off reguardless of which of the 3 buttons are pressed.
;even when only 1 is pressed.
Joy1::
Joy6::
Joy5::
MsgBox, Held Joy 5, Then Held Joy6, Then pressed Joy1!
Return




;This one is similar to the one near the top where it it works in either order
;Joy5 then Joy6 then Joy1 works
;But so does Joy6 then Joy5 then Joy1 so that is not good.
Joy1::
If GetKeyState("Joy6")
If GetKeyState("Joy5")
MsgBox, Held Joy 5, Then Held Joy6, Then pressed Joy1!
Return



I will also need to have Joy5>Joy6>POVhat Up , Joy6>Joy5>POVhat Up, and so on, but I haven't quite made it to that point yet.
Thanks again for any and all help/advice.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], metallizer and 152 guests