Mouse clicks debouncing: is it possible? (GNOME, Wayland)

My mouse is faulty (produces false double clicks), but is otherwise OK and I want to keep using it.
When I use X11 session, I feel there’s some filtering already happening by default, the mouse behaves OK unless I press the button a certain way.
When I use Wayland session, this doesn’t happen, there are lots of false double clicks.
I did some searching, seems like all existing software for this purpose is only working with X11, is that right? Or is there something that can do this already?

Just out of interest - does the spurious double-click happen repeatably and with other OS or in another PC?

Yes, this happens on Windows too (on the same PC), I’m sure the root cause is inside the mouse.
by the way, while using Windows I used this tool to neutralize it successfully:

1 Like

Interesting. I know DE’s input settings will let you set a maximum double-click window, but I haven’t seen one that lets you set a minimum window. It must be possible to do via libinput settings, though… to the Arch wiki!

Looks like libinput has debounce built in, but with hard-coded timeout values. There’s an AUR package for evdev that might be worth looking into:

Edit: OK, I’m now digging into

and will be testing this patch as I’m also seeing some occasional spurious bouncing with some relatively new hardware (both my Logitech Marble trackball and MX518 mouse can’t both be broken at the same time).

Edit 2: I’ve adapted the patch from the above post and tripled the timeouts:

diff --git a/src/evdev-debounce.c b/src/evdev-debounce.c
index 9864cac..594b168 100644
--- a/src/evdev-debounce.c
+++ b/src/evdev-debounce.c
@@ -124,7 +124,7 @@ static inline void
 debounce_set_timer(struct fallback_dispatch *fallback,
                   uint64_t time)
-       const int DEBOUNCE_TIMEOUT_BOUNCE = ms2us(25);
+       const int DEBOUNCE_TIMEOUT_BOUNCE = ms2us(75);

                           time + DEBOUNCE_TIMEOUT_BOUNCE);
@@ -134,7 +134,7 @@ static inline void
 debounce_set_timer_short(struct fallback_dispatch *fallback,
                         uint64_t time)
-       const int DEBOUNCE_TIMEOUT_SPURIOUS = ms2us(12);
+       const int DEBOUNCE_TIMEOUT_SPURIOUS = ms2us(36);

                           time + DEBOUNCE_TIMEOUT_SPURIOUS);

Built package is here: [sig]