I'm stuck, need help - RShift+RButton = click "x" if only RButton is released

Ask gaming related questions (AHK v1.1 and older)
WekizZ
Posts: 73
Joined: 14 Jul 2017, 04:40

I'm stuck, need help - RShift+RButton = click "x" if only RButton is released

Post by WekizZ » 05 Oct 2022, 11:40

I'm stuck, and can't figure out how this code should look... I tried adding more info next to every line.

Code: Select all

RShift::RButton 	;; While hold RShift and RButton 
~RButton:: 		;; send only standart RButton, RShift should be just a trigger for "x" button if RButton is released
KeyWait, RButton	;; check if RButton is still down
Send % ErrorLevel & GetKeyState("RButton", "P") ? "{x}" : "" ;; if only RShift is UP - just ignore all the script, if only RButton is up - send click button "x" and RButton Up
Return
It might look that I don't have any clue, I just try to put some stuff together I found in my notes...

Thanks in advance :angel:

Rohwedder
Posts: 7682
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: I'm stuck, need help - RShift+RButton = click "x" if only RButton is released

Post by Rohwedder » 05 Oct 2022, 12:07

Hallo,
RShift::RButton is definitely not "While hold RShift and RButton" !
Perhaps:?

Code: Select all

>+RButton:: ;RShift & RButton
KeyWait, RButton
Send % GetKeyState("RShift","P") ? "{x}" : ""
Return

WekizZ
Posts: 73
Joined: 14 Jul 2017, 04:40

Re: I'm stuck, need help - RShift+RButton = click "x" if only RButton is released

Post by WekizZ » 05 Oct 2022, 15:29

Rohwedder wrote:
05 Oct 2022, 12:07
Hallo,
RShift::RButton is definitely not "While hold RShift and RButton" !
Perhaps:?

Code: Select all

>+RButton:: ;RShift & RButton
KeyWait, RButton
Send % GetKeyState("RShift","P") ? "{x}" : ""
Return
Thanks for correction!

So when I test in notepad, it all works not bad. But then I realize I need it on LShift, but that's not the problem, I can use on the Right side, funny thing with LShift it doesn't work at all.

One more thing, the game also don't send {x}, anything else I can try in here?
Correction, if I hold in game RShift, RButton does nothing...

Rohwedder
Posts: 7682
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: I'm stuck, need help - RShift+RButton = click "x" if only RButton is released

Post by Rohwedder » 06 Oct 2022, 04:23

Then perhaps:

Code: Select all

<+RButton:: ; LShift & RButton
Send {RButton Down}
KeyWait, RButton
Send {RButton Up}
Send % GetKeyState("LShift","P") ? "{x}" : ""
; "x" if only RButton is released
Return

Post Reply

Return to “Gaming Help (v1)”