User Review Mouse Double click issue solution by coding

Since the last couple of days, I was quite troubled by the double-clicking issue of my mouse (Logitech G502 Hero)
Today, I came across a solution for this through a simple code which is posted on Reddit. I simply copy pasted it into my Logitech G Hub app and like magic, the issue is gone.
So, I wanted to share the procedure here for anyone who is facing the issue. This might even work for other branded mouse in through their respective apps (I don't know :))

Procedure:

1. Open Logitech G Hub app. Goto Manage profile in the dropdown as in the image.
1721750373292.png


2. In profiles, select the Scripting icon.
1721750848361.png


3. Rename the script to anything as required (I named it left click). Paste the code as in the image. Save and Run under Script dropdown. 90% job done.
Script:
EnablePrimaryMouseButtonEvents(true);
lastInstance = 0;
debounceTime = 5; -- debounce time in ms
buttonID = 1; -- 1 is primary mouse button, 2 is secondary, 3 scroll

function OnEvent(event, arg)

if event == "MOUSE_BUTTON_PRESSED" and arg == buttonID then
if(GetRunningTime() - lastInstance) >= debounceTime then
PressMouseButton(buttonID);
OutputLogMessage(" - Pressing button\n");
else
OutputLogMessage(" ! Too fast!\n");
end

elseif event == "MOUSE_BUTTON_RELEASED" and arg == buttonID then
ReleaseMouseButton(buttonID);
OutputLogMessage(" - Releasing button\n");
lastInstance = GetRunningTime();

else
OutputLogMessage("Booooring!\n") -- some button we don't care about
end
end
1721751186822.png


After all this is done, disable your left click like mine was disabled in the first image.
(IF THIS IS NOT DONE THEN EVERY LEFT CLICK WILL REGISTER AS TWO CLICKS. ONE FROM CODE AND ONE DEFAULT)

1721751646286.png


Note:
Never change the active LUA script (image 3). Since the left click is disabled, once the active script is changed, your left click stops working.
Either the script is to be made active again (image 3) or Default is to be selected for the left click to work again.
But how to do all this if the left click is not working?
Press windows Key. search for 'Mouse settings'. Change the primary mouse button to Right by using down arrow.
Now either select the script back or enable the left key. Reselect the primary mouse button to Left from mouse settings.

ENJOY.
Let me know if this is working. (Its working for me :))
 

Attachments

  • 1721750781150.png
    1721750781150.png
    99.7 KB · Views: 10
Well this is certainly new although I'm not sure of the resource usage and latency impact since you're intercepting every mouse event.
Other cheaper way is to just clean the mouse button switch using IPA or replace it.
 
Well this is certainly new although I'm not sure of the resource usage and latency impact since you're intercepting every mouse event.
Other cheaper way is to just clean the mouse button switch using IPA or replace it.
Not facing any issue. Even the drag and drop works. The debounceTime was 50 in the initial code. I changed it to 5 ms. since I felt 50 ms is too much time.

Also this site helps by checking if any double clicks are being registered or not.
 
I have used such script codes couple of years ago on one of my logitechs. I wanted to make some re-mappings etc. cant recall exactly but there are few such scripts on the net to try.
 
Interesting solution, but sadly only applicable to mouses used on a single computer. When my M235 started double-clicking I opened up it's switches and cleaned it with WD40. Problem solved. Hope it lasts a few more years.

Seems every Logitech mouses develops this fault within 2-3 years.
 
Interesting solution, but sadly only applicable to mouses used on a single computer. When my M235 started double-clicking I opened up it's switches and cleaned it with WD40. Problem solved. Hope it lasts a few more years.

Seems every Logitech mouses develops this fault within 2-3 years.
The above solution is an instant one. It only requires few clicks and its done. I agree that it is a temporary solution. Everything is fine but left clicks are not getting registered on Minecraft launcher. Except that remaining games are fine. Cleaning the switches is the ultimate solution.
 
Wow didnt know about this. When my Logitech G304 developed double clicking, I ordered 2 TTC Gold switches for Rs 200, disassembled the mouse to get the daughter board with the original omron switches and went to a mobile shop that soldered the switches for Rs 100. New switches so much better - its been three years and no trace of double clicking. This is great for those who may not want to tinker with the mouse. Cheers mate :headphone:
 
Wow didnt know about this. When my Logitech G304 developed double clicking, I ordered 2 TTC Gold switches for Rs 200, disassembled the mouse to get the daughter board with the original omron switches and went to a mobile shop that soldered the switches for Rs 100. New switches so much better - its been three years and no trace of double clicking. This is great for those who may not want to tinker with the mouse. Cheers mate :headphone:
It means the stock logitech switches are of inferior quality or have a very short lifespan.
 
To be honest, this defeats the purpose of a gaming mouse. This script sounds like it waits a little longer before telling the computer that a click has been detected. This adds latency to the response. Not noticeable for regular usage, but for competitive gaming, you're giving away a bit of advantage the mouse should give you.

@CrimeMouse don't use wd40. It leaves residue and will attract dust in Indian conditions and make things worse. Get a contact cleaner spray with minimal residue or change the switches.
 
Some mouse (and keyboards) have custom debounce function integrated into their software which you can set according to how you like. I don't understand why this isn't the industry standard. Surely it will reduce number of RMA's for them to process thus being beneficial for them to add.
I used to use a logitech g402 mouse and itworked great until it didn't and started having the same double clicking issue like others. It would fix by itself for some days then revert back to the problem. Now I use a razer basilisk v3 and its while it doesn't have double click issue its quality is inferior and scroll wheel started to stop working from time to time. So it seems like we can't a good mid-budget mouse without sacrificing on something.
don't use wd40. It leaves residue and will attract dust in Indian conditions and make things worse. Get a contact cleaner spray with minimal residue or change the switches.
I used WD40 for the scroll wheel since I had nothing else and it did make things worse but somehow fixed the problem after a few hours? I don't know what happened there and for how long it will stay fixed because I have used WD40 for squeaky door hinges etc and saw it does attract dust like you said. Guess that is one downside of it being a general purpose all rounder spray.
Is this the contact cleaner you are talking about? Also is it non-conductive? https://www.amazon.in/WD-40-Specialist®-Contact-Cleaner-400ml/dp/B0B9SZBLL8
Sorry if this derails the thread, thought I would talk about it for those looking for a more permanent solution than limiting click rate through a software.
 
I haven't tried the product in the link yet. It claims to be both non residue and non conductive.
The stuff I've tried all leaves residue. The best is deoxit which i got in the US but couldn't carry home because it was inflammable.

What i do these days is clean up the area around the switch with lots of spirit and leave it to dry for a while before using
 
Back
Top