Can I limit mouse click frequency?

I have a really annoying bug. This is not a bug report but I will report what the bug does to me. Occasionally when I middle click, it fires through two or three middle click events. I say occasionally but it comes in clusters. The effect of this purely annoying:

  • A link opens X times in X new tabs
  • I paste something into a terminal X times
  • I middle click to start freescrolling and if (X % 2 == 0) it thinks I didn't want to scroll at all.

This bug has haunted me for a long time. Right back to 9.04. Since then I've changed the following:

  • New motherboard (same CPU)
  • New mouse (Logitech => Razer)
  • New graphics card (still Nvidia, still binary driver)
  • New install of Ubuntu (copy of profile - but issue happens in new guest profile too)

There was a suggestion in the bug (that has now been deleted for inactivity) that the Nvidia driver could be the cause.

But I'm not here to talk to you all about the bug because we don't do bug reports here. Given the problem just won't die for me I thought I'd ask the many smart minds here if I could work around it. I have one idea:

Can I put a minimum delay on click events in X/XInput/whatever-mice-use?

If I could put a 50ms barrier in there, I'm certain it wouldn't affect me but it would nuke the bug.

Obviously if you're familiar with how to fix the bug outright, I also want to hear from you!


Turns out this problem was caused by a hardware fault in both mice. I fixed it by opening up my mouse and hosing down both the wheel and all the button swictes with compressed contact cleaner.

Unfortunately this dissolved the grease on the mousewheel rigging so I had to apply fresh silicone grease to these parts.

All in all, an £8 spend to bring a £100 mouse back to life seems like a fair deal. Yes, I paid too much for a mouse but it looks pretty.

enter image description here