Extremely simple: make "Shift+E" work as "Shift+Right Click" Topic is solved

Ask gaming related questions (AHK v1.1 and older)
Aphegis
Posts: 7
Joined: 02 Feb 2022, 11:02

Extremely simple: make "Shift+E" work as "Shift+Right Click"

Post by Aphegis » 12 Aug 2022, 14:56

Hello! I have a simple script in which it works with the LMB, but when i try to apply the same idea with the RMB it keeps behaving like the LMB in the same way, can please somebody help me? Here's what i have:


This is the simple code working with the LMB, i click shift+Q and it behaves like shift+LMB perfectly in any application.

Code: Select all

<+q::
    if( not GetKeyState("LButton" , "P") )
        Click down 
		Sleep 25
Return

<+q Up::Click up

The script i'm trying to do with the RMB.

Code: Select all

<+e::
    if( not GetKeyState("RButton" , "P") )
        Click down 
		Sleep 25
Return

<+e Up::Click up

Can anyone please help me? I'm really curious to see my mistake.Thanks a lot!

User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: Extremely simple: make "Shift+E" work as "Shift+Right Click"  Topic is solved

Post by mikeyww » 12 Aug 2022, 18:00

Click without a WhichButton parameter acts "upon" the left mouse button by default. See :arrow: Click.

Aphegis
Posts: 7
Joined: 02 Feb 2022, 11:02

Re: Extremely simple: make "Shift+E" work as "Shift+Right Click"

Post by Aphegis » 13 Aug 2022, 03:48

mikeyww wrote:
12 Aug 2022, 18:00
Click without a WhichButton parameter acts "upon" the left mouse button by default. See :arrow: Click.
Thanks so much! I love this software, now it works perfectly to what i need.

For anyone in the future maybe wanting the solution:

<+e::
if( not GetKeyState("RButton" , "P") )
Click, Right
Sleep 25
Return

<+e Up::Click up

I removed the "down", because otherwise the RMB remains pressed down. Thanks again Mike!

BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Extremely simple: make "Shift+E" work as "Shift+Right Click"

Post by BoBo » 13 Aug 2022, 03:54

@Aphegis
Thanks so much! I love this software
So you start posting your scripting code using the forum code tags? :o
That's great news! Happy scripting 8-)

User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: Extremely simple: make "Shift+E" work as "Shift+Right Click"

Post by mikeyww » 13 Aug 2022, 06:25

To send up:

Code: Select all

Click, R U

Post Reply

Return to “Gaming Help (v1)”