Code: Select all
#IfWinActive, ahk_exe mspaint.exe
~RButton::return
#IfWinActive
*RButton::Send, {RButton}
;The main part of the code
RButton & MButton::Send, #{Tab}
RButton & WheelUp::Send, #^{Left}
RButton & WheelDown::Send, #^{Right}
However, since the *RButton variant only triggers when the button is released, I cannot use the right (background color) brush in mspaint. So, I added the ~RButton in #ifWinActive. But it seems as though the ~ in this (conditional) variant of the hotkey forces ~ prefix on all its variants even when the #If is not satisfied.
Is there any way to use ~ only for the #If variant? If not, is there another way to achieve this kind of behaviour?