I want to capture the key event "right mouse button pressed, then left mouse button pressed". No problem in autohotkey. However I am having trouble with still allowing the right-mouse key to work alone.
1) this works:
RButton & LButton::
Send X
Return
works as expected:
- If I press right mouse button, then left mouse button, "X" is sent to the active window
- right-click event is captured by Authotkey: no context menu appears when I press the right mouse button alone. This is the intended outcome
2) this works
~RButton & LButton::
Send Y
Return
works as expected:
- If I press right mouse button, then left mouse button, "Y" is sent to the active window
- right-click event is not captured by Authotkey: context menu does appear when I press the right mouse button alone or together with the left button. This is the intended outcome
3) Now I want to do different things depending on the active window.
this does not work (careful: this will disable righ-click in every application)
#If WinActive("ahk_class MozillaWindowClass")
RButton & LButton::
Send X
Return
#If !WinActive("ahk_class MozillaWindowClass")
~RButton & LButton::
Send Y
Return
does not work as expected:
- in Firefox left-right sends X, in other applications left-right sends Y
- however, right-click is disabled in every application
What am I doing wrong here?
edit:
the goal is this: I want a global hotkey on Right+left-click with RButton & LButton
. In specific applications that I have tested for compatibility, I want right+left click to suppress sending right-click, and then send right-click manually using autohotkey. However, since some applications might have trouble processing mouseevents sent by autohotkey, in all untested applications I want to use ~RButton & LButton
with the ~ to pass throught right-click events