Skip to main content

Hacking Your Mouse To Fix The Misclick Of Doom

The Best Case Scenario And The Aged Scenario

All of this discussion about the non-ideal mechanical and electrical properties of switches is nice, but what does it actually translate to in practice? Here is what the signals from a fresh C&K ZMA00A switch look like with a 10kΩ pull-down resistor connected to both the Normally Open (NO) and Normally Closed (NC) contacts while the common contact is connected to 5V supply:

Image 1 of 2

Image 2 of 2

The oscilloscope is triggering on the first rising edge on the NO side to capture the moment the blade touches the NO contact and provide a repeatable timing reference for everything else surrounding the main event. The two signals are offset vertically by one division for improved readability. As the switch's plunger gets depressed, contact on the NC signal breaks cleanly most of the time (or not so cleanly in this case, since I deliberately picked a dirty break waveform to make sure I did not mislead some people into thinking that breaks are clean). Between the moment when the blade fully clears the NC contact and touches the NO contact, there is roughly one millisecond of travel time where the blade touches neither and both outputs are low. After that, the blade bounces for about 500µs on the NO contact before settling.

How repeatable is that switching performance? I turned infinite persistence on and triggered the switch about fifty times to see what sort of trends would emerge.

There is a spread of about 700µs between the quickest and slowest NC contact breaks, a minimum travel time of 840µs regardless of how quickly or hard I pressed the switch and the better part of 800µs of bouncing before the NO contact's signal becomes clean. You may also notice that the first three bounces on NO contact closure are highly repeatable. The black area between peaks indicates that each switch closure produces bounces that have nearly identical timing relative to the trigger, which is surprisingly regular considering that I was trying to be as irregular as I could in actuating the switch to get the most variance possible. When the switch's blade crosses the tipping point, whatever force was initially applied to the plunger to get there appears to have negligible further effect on the switch's own internal forces and the blade settles in the NO position within 700µs of bouncing. There did not appear to be a clear correlation between how quickly I pressed the switch and how quickly the switch went from break to make, except for the few times where I was deliberately pressing slowly and could hold the switch between breaking and the tipping point for arbitrarily long, which is where the NC signal entering the screen capture low (already open) comes from.

That's the performance of a nearly new switch, a few months old from the factory and maybe two thousand clicks into its life.

The Aged Scenario

What do those switching characteristics look like after many years of aging and likely over a million clicks? Based on what I said earlier about mechanical tolerances getting sloppier from wear, fatigue, oxidation and contamination, and electrical performance doing much of the same, you should expect the switch to get slower mechanically and noisier electrically.

Where will I find some well-worn switches for comparison's sake?

Nearly 20 years ago, when optical tracking was still new, I received a Logitech TrackMan Marble as a birthday present. Back then, these used to retail for around $100. I loved it until its left mouse button exhausted my patience. Not figuring out how to fix it and throwing it onto a shelf may have been a blessing in disguise, as I doubt my cramped thumb would have survived many more months of use.

Time to hook up that left button and see how well it fares in comparison.

In this single-click event, we see 800µs between the first sign of break on the NC contact and the signal going to a steady low, 4.2ms until the NO contact initially goes high, another 1.2 milliseconds for the bounces to settle and then a signal that never fully settles at the supply voltage due to dirty or oxidized contacts. That's 6.2ms total switching time for a representative sample on the worn switch versus 2.2ms worst-to-worst spread for the new switch. That's all the evidence I need to say that if I wanted a quick and easy fix, I should simply put in new switches and call it a day.

Let's accumulate waveforms through fifty actuations and see how much variance there is in the old switch's behavior.

I knew the old switch was bad, but I was not expecting it to be this horrible. The NC contact can take over 10ms to break, the travel time can exceed five milliseconds, and the NO contact still hasn't fully settled even 12ms after initial make. The old switch has a performance spread more than an order of magnitude worse than the new switch.

While not as steady as the new switch's, the old switch's first two to three bounces are still far more repeatable than I expected. The first two are clearly identifiable on the waveform. With the worst bounces still shorter than a millisecond, it should be easy to filter them out through various means.

  • Rheotome
    I'll never look at a Mouse the same way after reading this !!!
    Reply
  • SirGCal
    My problem with my MS is just finding a mouse I can use well period.I have some mice like this trackball myself and still can't use it properly. I need one controlled with the mind instead of hand. Which is probably coming sooner then we think.
    Reply
  • mrface
    This is a really cool article. Thanks for sharing.
    Reply
  • theaudiophile
    Holy shit, you're crazy in many many ways. I am an electronics hobbyist myself, and you sir are simply insane. I hope this article gets enough traffic and ad clicks to make up for the time you put in instead of replacing switches.
    Reply
  • mikesinner
    Both me and a friend of mine have already bought new mice, but I did keep the old one, a logitech G700 with the terribly annoying double click glitch when only single clicking. It's not a very old mouse either, so I find it very disturbing that the switch is already worn!
    Reply
  • Daniel Sauvageau
    17690562 said:
    Holy shit, you're crazy in many many ways. I am an electronics hobbyist myself, and you sir are simply insane.
    You give me too much credit. This is a simple hack once you know what you are dealing with - finding out what you have to work with is usually the most tedious part of a modification job, especially when you don't have design schematics or someone else's instructions to start from.

    The hack might be more trouble than it is worth but it does show that there is no reason for mouse buttons with SPDT switches to glitch until the switch mechanically fails. Other than mice manufacturers choosing to design them this that way that is.

    17690678 said:
    Both me and a friend of mine have already bought new mice, but I did keep the old one, a logitech G700 with the terribly annoying double click glitch when only single clicking. It's not a very old mouse either, so I find it very disturbing that the switch is already worn!
    My G500S is about four years old and the glitching is at that early stage where I'm not sure if the glitches are caused by the mouse or by mouse movement when I click.
    Reply
  • BulkZerker
    http://www.epicpants.com/t-shirts/tek-syndicate-gaming-mouse-standard-issue


    Problem solved.
    Reply
  • razor512
    Wouldn't it be easier to just use hall effect switches (like with some industrial machines)?

    The switches can be magnetically shielded, and as long as the button actuation functions (no broken springs), the button will continue to work, along with any vibrations of the actuation being calibrated out in software.
    Reply
  • buzzrattie
    Wish there were a mouse that was cat-hair proof. Dang little buggers shedding all the time, and getting into the laser.
    Reply
  • Daniel Sauvageau
    17691040 said:
    Wouldn't it be easier to just use hall effect switches (like with some industrial machines)?

    The switches can be magnetically shielded, and as long as the button actuation functions (no broken springs), the button will continue to work, along with any vibrations of the actuation being calibrated out in software.
    I doubt switches that require additional calibration steps would be popular in a market where manufacturers are trying to optimize every penny of profit they think they can get away with out of their product.

    One option which does not require calibration is optical sensing: poke a slotted stem through the detector. Most mechanical mice used optical wheel encoders to convert ball motion to digital. The same thing could be done for switches.

    I doubt either option would be as inexpensive as a mechanical switch and with the "memory" version of my hack, it would be a practically free fix. Free is a tough price to beat.
    Reply