Need Rbutton to activate both Rbutton's and Lbutton's normal functions

Ask gaming related questions (AHK v1.1 and older)
Kolo
Posts: 39
Joined: 21 Sep 2020, 16:46

Need Rbutton to activate both Rbutton's and Lbutton's normal functions

Post by Kolo » 20 Jul 2021, 08:57

aka 1 mouse button should activate both their normal functions.

Code: Select all

~Rbutton::
send {lbutton down}{rbutton down}
return
This only works if I hold Rbutton down. When I release....Lbutton continues to press itself cause its still pressed down....I have to tap it to stop. Mouse is not like keyboard presses. I'm upset that the community acts like they are. Mouse has helddown state and it has single press state. I want both of these states translated over. At worst I just need a fix to this specific cause where rbutton is held down.

When rbutton is held it should also hold Lbutton. when rbutton is released it should also release lbutton. The above code activates when rbutton is pressed....so I'm guessing any usage of

Code: Select all

If GetKeyState("RButton", "P")
send {lbutton down}
return
has to take place outside it. But this doesn't work outside of it. So do i use if not getkeystate()....well that is going to destroy the native function of LButton which is also a no-no. There should be no key destruction only key addition, I want to add Lbutton's workings to Rbutton. period.

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

Re: Need Rbutton to activate both Rbutton's and Lbutton's normal functions

Post by Rohwedder » 21 Jul 2021, 01:34

Hallo,
try:

Code: Select all

~RButton::LButton

Kolo
Posts: 39
Joined: 21 Sep 2020, 16:46

Re: Need Rbutton to activate both Rbutton's and Lbutton's normal functions

Post by Kolo » 21 Jul 2021, 11:32

Rohwedder wrote:
21 Jul 2021, 01:34
Hallo,
try:

Code: Select all

~RButton::LButton
This works. I don't understand why though or what this syntax is. Ur avoiding the use of the Send syntax, so I guess thats where my confusion lies cause I thought u had to use send to get anything like this to work. probably just not remembering the basic syntaxes here -_-

I'm guessing the ~ is keeping the original function of the Rbutton intact, while assigning additional function of the Lbutton.

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

Re: Need Rbutton to activate both Rbutton's and Lbutton's normal functions

Post by Rohwedder » 21 Jul 2021, 11:51

Yes, the ~ is keeping the original function of the Rbutton intact and the following is a remapping.
https://www.autohotkey.com/docs/misc/Remap.htm#Remap

Code: Select all

~RButton::LButton
will be translated to:

Code: Select all

~*RButton::
SetMouseDelay,-1
Send,{Blind}{LButton DownR}
Return
~*RButton up::
SetMouseDelay,-1
Send,{Blind}{LButton Up}
Return

Post Reply

Return to “Gaming Help (v1)”