add Mouse Click Debounce Feature?

Bug #602809 reported by Dan Hobson
128
This bug affects 28 people
Affects Status Importance Assigned to Milestone
xserver-xorg-input-evdev
New
Undecided
Unassigned
xserver-xorg-input-evdev (Ubuntu)
Confirmed
Wishlist
Unassigned
xserver-xorg-input-libinput (Ubuntu)
Confirmed
Wishlist
Unassigned

Bug Description

Model: bonp3
OS: Ubuntu 10.04 LTS

When I single click the mouse (external USB Mouse - Mouse Pad disabled) half the time the system responds as though I have double clicked the mouse. I try 2 different USB mouse units and it still does this. I am running Ubuntu 10.04 on a separate PC that does not have this mouse problem. So I am thinking this problem is a System76 driver issue???

It's annoying. :(

Revision history for this message
Dan Hobson (wd5jhi) wrote :

I tried a third mouse and didn't experience this issue. So it may be a mouse issue. You can cancel this if you want.

Thanks,

Dan

Revision history for this message
Ian Santopietro (isantop) wrote :

Yeah, if you made no changes to your configuration, and one mouse works just fine, it seems like a problem with two faulty mice. If you feel this is recurring, go ahead a send us an email at support...at...system76...dot...com.

Changed in system76:
status: New → Invalid
Revision history for this message
Zhang Weiwu (zhangweiwu) wrote :

I am re-opening this bug on accessibilty ground.

Debounce feature exists in AccessX. It was not intended for faulty keyboard. It is intend for users who cannot preciously do one key press.

Quote from wikipedia:
Bounce keys is a feature of computer Desktop Environments. It is an accessibility feature to aid users who have physical disabilities. Bounce keys allows you to configure the computer to ignore rapid, repeated keypresses of the same key.

It seems apparent to me that anyone who couldn't do preciously a single key-press, also could not do a single mouse key-press. Thus this should be an accessibility feature request.

Changed in system76:
status: Invalid → New
summary: - Mouse Click Debounce Disabled
+ add Mouse Click Debounce Feature?
Revision history for this message
Yves-Gwenael Bourhis (yves-gwenael-bourhis) wrote :

I changed mouse 3 times (different brands), and have the issue with all new USB mouse I can buy (only the internal touchpad of my laptop works, and my OLD mouse, but I don't find the touchpad comfortable to use and wanted to have a new mouse)

However, I have dual boot with Windows and I only have the issue with Linux (whatever USB mouse I use), so it looks like Windows has integrated a software handled mouse debouncing, and that by knowing this manufacturers bother less putting quality mouse contacts and all new mouse I bought had the issue (except my OLD one and my touchpad).

I followed the instructions posted here:
http://blog.guntram.de/?p=16

Using Matt Whitlock's patch here:
http://lists.x.org/archives/xorg-devel/2012-August/033225.html

to build an xserver-xorg-input-evdev_2.8.2-1ubuntu3_amd64.deb package and created a /usr/share/X11/xorg.conf.d/12-evdev-debounce.conf file containing:

    Section "InputClass"
     Identifier "evdev pointer debounce"
     MatchIsPointer "on"
     MatchDriver "evdev"
     Option "DebounceDelay" "25"
     EndSection

and this has totally and definitely solved the issue for me.

I can attach here the xserver-xorg-input-evdev_2.8.2-1ubuntu3_amd64.deb (For trusty) I've build if anyone asks, but I suggest that having a minimum software debounce should be considered seriously.

Am I the only one having this issue? I don't really want to spend all my money buying a new mouse until I find a working one, I've already spend more than a hundred Euros in 3 non-working mice, and I can't get them refunded because the shops (different ones) where I bought them test the mouse under windows when I return it, and give it back to me refusing the refund because for them it works :-( (and when I test them under windows they indeed do work like a charm so this is quite frustrating).

Since Matt's patch works like a charm, it should be considered seriously.

Revision history for this message
bHarder (briana-harder) wrote :

I have had this problem on every single Logitech wireless mouse (sample size 6) I've owned over the years. A year of regular use and whatever hardware debouncing they do have stops being enough. Then the switches have to be cleaned and the springs retensioned, which is a hassle. One that can easily be avoided with a software fix, I've got a handful of options on my Windows machines to turn to when the built in software debouncing in the OS fails to catch the bounce.

The patch by Matt Whitlock mentioned earlier fixes the problem completely.

Changed in xserver-xorg-input-evdev (Ubuntu):
status: New → Confirmed
Revision history for this message
Nemes Ioan Sorin (nemes-sorin) wrote :

this is true
got an RAT7 (Mad Catz)
and right click sometime give 2 or 3 click events

a lot of peoples(and I really mean A LOT) using expensive devices (mice) are deep into this problem

fundamentally incredible is the fact that all guru's talk about bad hardware on the linux side, leaving the problem unsolved - on windows they all use the same trick for all devices (using autohotkey).

spending many hours over the internet to find a linux easy solution, I found that the ultimate solution is to patch the evdev driver.
how many peoples will rebuild evdev is my question ? - very few is my response - people use Ubuntu / Mint for ease of use - geeks use Arch < those guys know what to do but many Ubuntu users will leave the problem unsolved .. therefore please add this patch into evdev mainline.

Thanks in advance ...

Nish Aravamudan (nacc)
Changed in xserver-xorg-input-evdev (Ubuntu):
importance: Undecided → Wishlist
Revision history for this message
Eric Sandall (eric-wz6bkyhu4uqp) wrote :

I'm still seeing this issue with a Logitech G700 with Linux Mint 17.3 (based on Ubuntu 14.04). I did not need Whitlock's patched evdev driver, but adding Comment #4's xorg.conf work-around seems to have alleviated this issue for me.

Revision history for this message
Alex Garel (alex-garel) wrote :

I am also having this issue since a long time (2 years or more), and this is really annoying. I also think software debouncing should be proposed.

Revision history for this message
Alexander Thomas (doctor-lex) wrote :

I also started noticing this recently. I tried a different mouse and it had the same problem. I expected to have at least some way to tweak a low-level config file to increase the debounce interval, but apparently it isn't implemented to begin with.
I reckon this isn't only annoying for people who didn't win the ‘perfect mouse’ lottery, but also for those with certain disabilities. If debounce is implemented for keyboards, then it only makes sense to implement it for any other input device with hardware buttons as well.

Revision history for this message
hanspr (hanspr) wrote :

I agree this should be implemented, I have a new mouse and has the same issue and is not a cheap mouse. If there is a patch that works should be considered.

Revision history for this message
JohnWashington (ubuntu-johnwash) wrote :

Affects me with one mouse on Mint 18.3 (also verified on another pc with Ubuntu 16.04).

See extensive discussion, including how to investigate with xev, detailed code fix for xserver-xorg-input-evdev, detailed hardware workarounds for mice with contact bounce:
https://askubuntu.com/questions/321816/mouse-sometimes-doubleclicks-when-i-click-once

I'm amazed the software debouncing still hasn't been incorporated. And debounce time etc ideally should be exposed to the user in the control panel, to allow adjustment?

no longer affects: system76
Revision history for this message
Herman Grobler (mpdtech) wrote :

Is there any update on this, I use a MSI mouse and MSI keyboard. The issue is most notable on my mouse, but I have duplicate key press events on my keyboard as well.
I'm sure allowing the debounce delay to be configurable will be a quick win here as JohnWashington suggested.

Revision history for this message
Yves-Gwenael Bourhis (yves-gwenael-bourhis) wrote :

yves@paradox ~ $ dpkg -l | grep -i libinput
ii libinput-bin 1.10.4-1ubuntu0.18.04.1 amd64 input device management and event handling library - udev quirks
ii libinput-tools 1.10.4-1ubuntu0.18.04.1 amd64 input device management and event handling library - command line tools
ii libinput10:amd64 1.10.4-1ubuntu0.18.04.1 amd64 input device management and event handling library - shared library
ii xserver-xorg-input-libinput 0.27.1-1 amd64 X.Org X server -- libinput input driver

https://lists.freedesktop.org/archives/wayland-devel/2017-October/035469.html says:
"Pointer devices now have button debouncing automagically enabled.
Ghost button release/press events due to worn out or bad-quality switches
are transparently discarded and the device should just work."

Well, I'm terribly sorry to say that the automagic debouncing feature from libinput announced in the link above simply does not work at all...

Even with the new libinput, fresh install, I get multiple clicks (only in Linux).
It's been 9 years that this problem is on and not only unsolved but just getting worse since these days no new hardware works at all...

Only very old mouse devices or this electronic solution currently work:
https://askubuntu.com/questions/496131/set-mouse-debounce-time

Could a user setting be at last added after 9 years of other solutions always failing?

Thanks in advance.

Revision history for this message
Yves-Gwenael Bourhis (yves-gwenael-bourhis) wrote :

For your knowledge, they refused here to fix the issue which was opened 12 years ago:
https://bugs.freedesktop.org/show_bug.cgi?id=11833

Changed in xserver-xorg-input-libinput (Ubuntu):
importance: Undecided → Wishlist
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xserver-xorg-input-libinput (Ubuntu):
status: New → Confirmed
Revision history for this message
JohnWashington (ubuntu-johnwash) wrote :

This isn't just of value to people who happen to have a mouse that's a bit iffy, who get a bad impression of Ubuntu because the same mouse works fine on Windows (see bug #1).

It's possibly also of benefit to those who have difficulty with muscle control, especially the elderly. Maybe this bug can get a raised profile if we play the accessibility card?

But most likely what it takes is some capable volunteer to write the code to fix it and get a patch accepted. Few of the bugs I've marked as "me too" ever get fixed by Canonical.

Revision history for this message
Yei Gei (yzgyzg) wrote :

Here is a patch for libinput which worked for me. The debounce time is hard coded to 25 ms and 12 ms. The patch will increase it to 100 ms and 50 ms. I hope it will help.

libinput_debounce_time.patch

--- a/src/evdev-debounce.c 2020-06-19 10:00:40.778552300 +1000
+++ b/src/evdev-debounce.c 2020-07-27 02:02:52.343254576 +1000
@@ -124,7 +124,7 @@
 debounce_set_timer(struct fallback_dispatch *fallback,
                   uint64_t time)
 {
- const int DEBOUNCE_TIMEOUT_BOUNCE = ms2us(25);
+ const int DEBOUNCE_TIMEOUT_BOUNCE = ms2us(100);

        libinput_timer_set(&fallback->debounce.timer,
                           time + DEBOUNCE_TIMEOUT_BOUNCE);
@@ -134,7 +134,7 @@
 debounce_set_timer_short(struct fallback_dispatch *fallback,
                         uint64_t time)
 {
- const int DEBOUNCE_TIMEOUT_SPURIOUS = ms2us(12);
+ const int DEBOUNCE_TIMEOUT_SPURIOUS = ms2us(50);

        libinput_timer_set(&fallback->debounce.timer_short,
                           time + DEBOUNCE_TIMEOUT_SPURIOUS);

Revision history for this message
Joe Conway (a-mail-k) wrote :

FWIW I have been plagued with this same issue for a long time now and the libinput_debounce_time.patch above* fixes the problem for me.

Obviously hard coding these values is a bad idea -- will this ever get fixed properly?

* I had to adjust it to get it to apply on my LM20 system (libinput-1.15.5), and I used 60 ms and 30 ms instead of 100/50. Many thanks to Yei Gei (yzgyzg) for posting.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.