Middle Button not registering

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
wawawa
Posts: 4
Joined: 15 Aug 2018, 09:53

Middle Button not registering

15 Aug 2018, 10:22

Hey there!

I recently bought a new mouse (Spirit of Gamer PRO-M5), and since then, my script doesn't work properly. The script is fairly simple : after you press middle mouse button, it swap inventory. Here the code :

Code: Select all

*MButton::
{
	invSwap(1);
}
return

invSwap(slot)
{
	MouseGetPos, mousePosX, mousePosY ;mousePosX/Y have old mouse position
	ControlGetPos, xpos, ypos, width, height,, A ; Get width and height of A(ctive) window
	slotX := xpos + (0.72 * width)
	slotY := ypos + (0.68 * height)
	if slot > 4
	{
		slotX += (0.06 * width) * (slot - 4)
		slotY += (0.06 * height)
	}
	else
	{
		slotX += (0.06 * width * slot)
	}
	MouseMove, slotX, slotY
	Click, 2
	MouseMove, mousePosX, mousePosY
}
return
the invswap function makes you double click somewhere ingame to swap gear.

On my old mouse, the script starts whether you hold left mouse button or not.
But on that new mouse, it's a little weirder :

- Holding left button and pressing middle button => not working
- Holding any other key (even right button) and pressing middle button => working
- Not holding any key and pressing middle button => working
- Changing hotkey to any other button and holding left button => working

the middle mouse button is not even recorded in the key history while holding left mouse button (but the middle click is recognized otherwise).

At this point, I assume there's something with this particular mouse and that I can't do anything about it with ahk, but in case someone got some more knowledge on this behavior, and perhaps know how to fix it, please let me know :)
MannyKSoSo
Posts: 440
Joined: 28 Apr 2018, 21:59

Re: Middle Button not registering

15 Aug 2018, 10:36

To see if your ahk is accepting your middle mouse button check this code on a text editor and see if it actually doing anything

Code: Select all

*MButton:: send z
You should see the letter z occur each time it is pressed (and test this with the LButton as well to make sure its working). If it doesn't work with the left button then it could be an issue with the left button overriding the middle mouse input.
wawawa
Posts: 4
Joined: 15 Aug 2018, 09:53

Re: Middle Button not registering

16 Aug 2018, 04:47

MannyKSoSo wrote:To see if your ahk is accepting your middle mouse button check this code on a text editor and see if it actually doing anything

Code: Select all

*MButton:: send z
You should see the letter z occur each time it is pressed (and test this with the LButton as well to make sure its working). If it doesn't work with the left button then it could be an issue with the left button overriding the middle mouse input.
So I tried the same kind of thing already (and yours too :p) on both my mouses, and on my old one, it works, but on the new mouse, it get recognized only when not holding left mouse.

AIso, if I hold left mouse, then hold middle mouse, then release left mouse, at this moment the middle mouse gets triggered. If I still hold left middle mouse and start spamming left mouse, the middle mouse gets triggered every time I release left mouse.

But changing the MButton to let's say RButton make the code work normally on both mouses. The "LButton DOWN" blocking MButton and then the "LButton UP" reactivating MButton (even if it was pressed long before I click LButton) is only happening on this particular mouse.

Is there a way in ahk (or something else) to prevent this mouse LButton to act in such a weird way?

edit : I took some screenshot of the key history so that would help understand, and looking at it, some MButton triggers gets suppressed somehow, which is most likely the cause of the glitch.

Image

Image
MannyKSoSo
Posts: 440
Joined: 28 Apr 2018, 21:59

Re: Middle Button not registering

16 Aug 2018, 07:30

Interesting results, it really sounds like a case of a bad driver or something along those lines. Have you tried at all reinstalling the new mouse drivers? Also you can also try this code

Code: Select all

LButton & MButton:: send z
Since it looks like the native input is being affected in some way then the code above should send the character test regardless if you are holding the button down as it will not send the LButton while it does the send command.
wawawa
Posts: 4
Joined: 15 Aug 2018, 09:53

Re: Middle Button not registering

16 Aug 2018, 13:52

MannyKSoSo wrote:Interesting results, it really sounds like a case of a bad driver or something along those lines. Have you tried at all reinstalling the new mouse drivers? Also you can also try this code

Code: Select all

LButton & MButton:: send z
Since it looks like the native input is being affected in some way then the code above should send the character test regardless if you are holding the button down as it will not send the LButton while it does the send command.
I didn't found any driver on the website nor on the box, only installed it by pluging it in haha

I tried your code, and sadly z was never sent, as mbutton and lbutton can (it seems) never be recognized at the same time :/
MannyKSoSo
Posts: 440
Joined: 28 Apr 2018, 21:59

Re: Middle Button not registering

16 Aug 2018, 13:58

So if you go to Device Manager you will have a thing for "Mice and other pointing devices" and click on the new mouse and hit the little green up arrow that is for update driver software. This will find the software and update it (since yours is plug and play).
wawawa
Posts: 4
Joined: 15 Aug 2018, 09:53

Re: Middle Button not registering

17 Aug 2018, 06:15

MannyKSoSo wrote:So if you go to Device Manager you will have a thing for "Mice and other pointing devices" and click on the new mouse and hit the little green up arrow that is for update driver software. This will find the software and update it (since yours is plug and play).
I wish :/

Image

Any other ideas maybe ? :)
User avatar
Nextron
Posts: 1391
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win10 AHK: Unicode x32

Re: Middle Button not registering

17 Aug 2018, 06:32

I would say it's a hardware issue (either defect of design) that cannot be fixed by software.

Based on your screenshot, when you're holding MButton and press LButton, MButton is logically released. It could be that there's a hairline fracture in the MButton circuitry, that is opened by the stress of pressing LButton. It could also be a dumb firmware bug.

I'd contact the support department of the device to ask if then can reproduce the behavior. They don't even need AHK, just ask if they trigger the autoscroll circle thingy when holding LButton en pressing MButton. If they can't: get a different mouse. If they can: get a replacement mouse.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], haomingchen1998, Thorlian and 291 guests