Hacking Your Mouse To Fix The Misclick Of Doom

Ever had your patience put on trial by glitchy mouse buttons? That is one problem that simply should never have been on any half-decent mice.

Do you remember mechanical mice? They either had a gummy or rough ball protruding through the bottom to transfer motion to rollers mechanically coupled to optical rotary position encoders. The ball would inevitably pick up all sorts of crud from your mousing surface, which would then cake up on rollers until they eventually got stuck and required cleaning.

Once the ball's gummy coating wore out or its grippy surface got polished off (which rarely took more than a year of intensive use), the ball no longer had enough friction to turn the encoders' rollers. The mechanical mouse became nearly unusable, regardless of how much you tried to clean it. This usually meant buying a new mouse long before anything else had a chance to fail. Optical tracking eliminated that major mechanical shortcoming, enabling mice to remain usable for a few years longer and reveal their next major service life limitation.

Have you ever had a drag-and-drop file or text selection mysteriously disappear or reset on you as you pulled the mouse pointer from one corner of a selection to the other? How about single clicks registering as doubles, performing actions you never intended? In productivity applications, this can result in accidental file transfers and other irritating outcomes. In games, it can trigger the wrong ability or interface action, such as prematurely releasing an arrow, shot or other hold-to-aim/charge ability. That sort of outcome is simply unacceptable in a competitive environment.

So what's the issue here? Switches. The humble switch is the only remaining mechanical component still used in modern mice if we overlook the cord. While most PC enthusiasts associate switches with electricity, they're still mechanical systems performing an electrical function, which makes them inherently susceptible to wear from friction where different components rub together and material fatigue where these components are under mechanical loads, both static and dynamic.

And even though switches may look ideal at macroscopic time scales, with a contact closing and opening, they're not so binary as seen from a digital circuit's point of view in millisecond and less time scales.

This combination of less than ideal mechanical and electrical contact properties are the reasons why debouncing (the process of filtering or processing switch inputs to hopefully eliminate mechanically-induced glitches) is necessary when interfacing switches to logic and micro-controllers. As switches age, their characteristics degrade to the point of exceeding the debouncing circuit or algorithm's parameters, letting glitches through with increasing frequency and severity.

MORE: All Mice Content
MORE: All Peripherals Content

MORE: Peripherals in the Forums

Create a new thread in the UK Article comments forum about this subject
This thread is closed for comments
5 comments
Comment from the forums
    Your comment
  • Chris_303
    That was stunning and very well documented and implemented, you should be congratulated sir :-)
    0
  • kyzarvs
    An excellent and knowledgeable article and I remember past rodents having all sorts of problems as described. I still spend nostalgic periods cleaning the ball / rollers of my Amiga mice - still going (just) after 20+ years! For the last 10 years or so though, I find the glide pads on the bottom of my mice (always upper-midrange Logitech, at the moment I have 3x Performance MX for my work, home and contracting machines) wear out well before the buttons start to perform badly.
    0
  • LanVlam
    The sort of most useless time consuming mod acticle that i read with so much pleasure and interest :) Can you do a Nes 8 bit or Sega genesis or Amiga 500 joystick to pc conversion? They all have their strange own way of communicating i noticed. Or a joystick/midi port gamepad i have made working for ps2/com or usb or something?
    0
  • kyzarvs
    Anonymous said:
    The sort of most useless time consuming mod acticle that i read with so much pleasure and interest :) Can you do a Nes 8 bit or Sega genesis or Amiga 500 joystick to pc conversion? They all have their strange own way of communicating i noticed. Or a joystick/midi port gamepad i have made working for ps2/com or usb or something?


    A modern pad -> amiga conversion would be really handy.
    0
  • XavierTaylorUK
    To be honest i only understood about 50% of what you wrote, need to go do some more revision. However articles like this are why the internet is amazing. Thank you for sharing your knowledge.
    0