Different behaviour BUT same script?! (middle click macro) Topic is solved

Ask gaming related questions
homezonebenny
Posts: 18
Joined: 23 Apr 2016, 08:36

Different behaviour BUT same script?! (middle click macro)

16 Dec 2016, 08:15

Hi,
I rebound my "Middle Click" of my mouse to F3 to make this script work:

Code: Select all

#IfWinActive World of Warcraft ahk_class GxWindowClass
$F3::
Send, {F3}{MButton}
return
#IfWinActive
When I press F3 it press:
F3 and MiddleClick
at the same time

When I hold down SHIFT and press F3 it press:
SHIFT + F3 and SHIFT + MiddleClick
at the same time

Same behaviour for CTRL and ALT. It's exactly like I want it.
But now I decided to but my mouse back for default (MiddleClick is MiddleClick again) so that my MiddleClick works like normal (for Browser Tabs and stuff like that).

So I decided to make the script like that:

Code: Select all

#IfWinActive World of Warcraft ahk_class GxWindowClass
$MButton::
Send, {F3}{MButton}
return
#IfWinActive
But now something totally strange happens...

When I press MiddleClick it press:
F3 and MiddleClick
at the same time. So it works like it should :-)

BUT when I press SHIFT + MiddleClick it do nothing.
It should be the same behaviour like with the F3. It should press:
SHIFT + F3 and SHIFT + MiddleClick
at the same time, but it do not... Same for ALT and CTRL.

Why is it like that?!
AHK seems to handle mouse buttons differently like keyboard buttons.

Do I need to add scripts like that to my normal script:

Code: Select all

#IfWinActive World of Warcraft ahk_class GxWindowClass
+$MButton::
Send, {SHIFT Down}{F3}{MButton}{SHIFT Up}
return
#IfWinActive
But what IF I have to press: SHIFT and ALT with the MiddleClick?!
Then I would need to add a script for "every modificator" possible...
Like:
[*]Shift
[*]Ctrl
[*]Alt
[*]Shift + Ctrl
[*]Shift + Alt
[*]Ctrl + Alt

That would just be to much... I mean, it's working 100% perfectly fine with $F3:: but why isn't it working with $MButton:: ?!?!
Thanks for your help. This is something I totally don't understand to be honest. Why AHK acts differently.
luciga
Posts: 30
Joined: 01 Dec 2016, 08:52

Re: Different behaviour BUT same script?! (middle click macro)

16 Dec 2016, 08:28

Hi there,
Sorry, I didn't understand your question.
homezonebenny
Posts: 18
Joined: 23 Apr 2016, 08:36

Re: Different behaviour BUT same script?! (middle click macro)  Topic is solved

16 Dec 2016, 09:42

I guess I found the solution:

Code: Select all

#IfWinActive World of Warcraft ahk_class GxWindowClass
*$MButton::
Send, {Blind}{F3}{MButton}
return
#IfWinActive
I tested around with the * in front of the hotkey.
But it wasn't working. Because it did not send the SHIFT / CTRL / ALT modificators.
But with {Blind} it's sending them now.

* means accept every other "pressed" key.
And the {Blind} set this pressed key in front of my send buttons :)
That's how I understood how it works.
This script works 100% fine when you want to make a MiddleClick macro.

When I press MiddleClick with/without ANY modificator it press:
Middle Click + F3

And when I use SHIFT + MiddleClick (mouse wheel) it press:
SHIFT + MiddleClick AND SHIFT + F3
at the same time. The same for ALT, CTRL and all other modificators.

If you want to make a macro like, press every key one after another, just use:
SendInput
instead of:
Send

Return to “Gaming”

Who is online

Users browsing this forum: Google [Bot], nex2022 and 20 guests