1
votes

I don't understand why most of the suggestions aren't working for me, so I'm asking here.

I'm trying to get AHK to right click when I press a shortcut. I found a couple of ways to do it:

^R:: RButton
return

and

^R:: AppsKey
return

and

^R:: Click Right
return

as well as a few others.

However, none of these actually seem to right click as if I were physically right clicking with my mouse. They all seem to right click as though ^R was remapped to Shift+F10, or some other system right click. What I actually want is a real right click, emulated just as if I were right clicking with my mouse. It should work in folders, applications, everywhere. Is there a way to do this?

1
I'll try to help if you supply steps to reproduce the problem. Also a test I can perform that demonstrates how the autohotkey command differs from a real right click. When I do ^r:: Click Right it behaves like a native right click for me. - Jim U
Hmm... I just realized the problem must be with the script file I'm trying to put it in! Your command works fine when I put it in a new script file. Thanks a lot for your help! Definitely wouldn't have figured this out without your comment :) - Skeleton Bow

1 Answers

3
votes

As @Jim U said in the question's comments, put it in a new script file. From your reply to his comment it seems that solved the problem, so I have written this answer to clarify that.

In programming generally, always isolate the code first as the problem can be caused by something elsewhere.