Right clicking on mouse position Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
LAPIII
Posts: 668
Joined: 01 Aug 2021, 06:01

Right clicking on mouse position

Post by LAPIII » 28 May 2023, 18:07

In Edge, using Autohotkey to press the Appskey shows a context menu in the upper left. I'm trying to right-click at the cursor, but it doesn't work:

Code: Select all

z::{
MouseGetPos &xpos, &ypos		; Gets mouse position
Click &xpos, &ypos, "Right"		; clicks right mouse button
}

niCode
Posts: 293
Joined: 17 Oct 2022, 22:09

Re: Right clicking on mouse position

Post by niCode » 28 May 2023, 18:48

Removing the ampersands works for me, as they are not needed there.

Code: Select all

z::{
    MouseGetPos &xpos, &ypos		; Gets mouse position
    Click xpos, ypos, "Right"		; clicks right mouse button
}

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

Re: Right clicking on mouse position  Topic is solved

Post by mikeyww » 28 May 2023, 18:52

You do not need to get the position to click in place. This is explained in the second paragraph of the documentation.

Code: Select all

#Requires AutoHotkey v2.0
z::Click 'R'

Post Reply

Return to “Ask for Help (v2)”