Taming the Wild Rodent: Unintended Double-Clicks

You’d think that with three cats in the house, we’d have no problem with mice, but for some reason they completely ignore the kind that plug into the computer. I should fire the lot of them. 🙂

I have a really nice wireless Logitech mouse. Just a simple one, but it gets the job done, and I only have to replace the batteries maybe every five or six months. I’m extremely happy with it, except for one thing.

Late last year, I started noticing that left-clicks on it were occasionally being interpreted as double-clicks instead. Only maybe one time out of every twenty or thirty clicks, but enough to be irritating. After installing the latest Ubuntu (9.04, or “Jaunty Jackalope”), I decided to find a fix for it.

[EDIT: If you’ve got the same problem, read the comments below this article before trying this solution. It helped, but not enough.]

There were several reports of similar problems, and the recommended fix seemed to be to modify /etc/X11/xorg.conf, adding "CorePointer" to one of the mouse-configuration lines. Which would be great — except that this version of Ubuntu moved the handling of mice to a component called HAL (I’m assuming that’s for “Hardware Abstraction Layer”), and completely removed all the configuration lines in xorg.conf.

I’ve spent many hours over the last week, trying to figure out how to translate that option to HAL. And when that failed, trying any other option I could dig up or think of. So far as I can tell, there’s simply nothing you can do through HAL to solve this.

As of last night, I was ready to give up on it, but my stubborn determined nature wouldn’t allow me to. Like it or not, I had to solve it, even if I had to dig into the source code for the mouse driver and change it there — logically the fix is simple enough, if the system sees a double-click that’s too fast for a human to have made, simply ignore it. Enough people seem to have had this problem that somebody must have thought to add that option into a mouse driver, and if it was available anywhere, it would be in Linux.

Well, as the saying goes, it’s always darkest just before the dawn. I had the idea to search for:

linux "minimum double click"

That led me to someone talking about an option in a program called btnx (which apparently didn’t work in the previous version of Ubuntu due to a bug in the X-server, but does in this version). I downloaded it, followed the instructions for setting it up, and configured the left button to be interpreted as the “key combination” BTN_LEFT, with a “repeat delay” of 100 milliseconds. Then I started the btnx daemon, took a deep breath, and started clicking the title bar of one of the Firefox windows on the screen, one click per second, using the faint but audible ticking of my wall-clock to time them.

Not once in five full minutes — that’s three hundred clicks — did the window maximize itself! Previously it would do so after somewhere between five and seventy clicks, as the system saw something it erroneously interpreted as a double-click. Problem solved!

Now if I could just find a similar program for my occasional forays back into Windows… 😉

7 Comments

  1. Get a mac, then you’ll only have one button to click, leading to longer mouse-life. 😉 (Actually, I always use multi-button mice with my Mac, and even Apple’s Mighty Mouse can be configured now to have multiple selection buttons, though for historical reasons it’s not the default. (It has a smooth top that has detection stuff on both sides and side buttons that default to exposé – kind of neat but the trackball scroll-wheel gets dirty and fails within about 6 months, and then the mouse has to be cleaned via dis-assembly even though it is not meant to be disassembled – so I’ll never get one unless they fix this design flaw. Apple really needs to fire their mouse engineering team, between the Mighty Mouse that dies, and, worse yet, the Hockey Puck, they really should be ashamed of themselves. 😉 ))

  2. As I’ve mentioned before, I’d like to get a Mac someday. But right now, with all my projects, I’ve got too much to do to delve into a new operating system (and I wouldn’t be content to have one without digging into it pretty deeply, that’s just my nature).

    It turns out that the double-click problem isn’t completely solved. I increased the time to 200 milliseconds, but I’m still seeing double-clicks at times, usually in Firefox. They’re definitely rarer, but I think I’m going to have to disassemble this mouse and break out the soldering iron to replace the left-button switch. That’s a project for another day though.

  3. <sigh>

    Either the btnx solution was only temporary, or the switch was right on the edge of dying completely. The problem has kept getting worse over the last couple days, and even turning the delay up to 400ms didn’t do much to fix it. I broke down and bought another mouse today… same style, so at least if/when this one dies I’ll have spare parts to fix it. 🙂

  4. Well, as you know, I was just joking about a Mac solving this problem. I was having a different problem with this same mouse and it turned out to be from a loose USB dongle connection at first I thought it was OS X and I did a non-destructive reinstall (MS take notes) but of course it didn’t get fixed because it was a mouse problem. (The problem was mouse-overs didn’t work, everything else did. Very strange…)

    (I’m partially back online, my dell mini 9 has a free wifi connection if in one room of the house, which happens to be my bedroom. 🙂 I had neglected to put in my encryption key when I upgraded Ubuntu on it, and my desk is still at the old apartment so I’m not setting up my desktop yet as in order to have it function I’ll need my external firewire disk array from hell working too, the big monitor that would have to go on the floor, etc.)

    By the way I’m running Linux mostly until the mac is running so I should hold off on the “get a Mac” jokes. 🙂

  5. I don’t see any reason why your login shouldn’t work. If the problem continues after you’re set up again, we’ll work on it then.

Comments are closed.