Just got a new mouse (glorious model o) and I can get double clicks on it (I click once, get two clicks) however I can only get it to register two clicks on windows. I've done some research and I'm pretty sure that it is libinput
preventing double clicks by default. Is there any way to make it so that it doesn't try to cancel the double clicks? I know for most people preventing double clicks is useful however I want to be able to double click to get higher CPS in Minecraft and I never manage to accidentally get a double click.

- 117,780

- 73
- 1
- 6
2 Answers
Just reposting the discussion in comments as an answer.
First of, to avoid confusion: OP does not have a hardware button for double-clicks. Rather, the double-click they were referring to is when you tap left mouse button in such a special way so it bounces and causes 2 clicks. I could reproduce it with my mouse too.
This is almost never a wanted behavior, so libinput has a debounce algorithm in place, which detects and discards such bounces. (and just for the record: it works fine with hardware double-click buttons). So OP asked if they can disable it locally.
It is indeed possible via quirk subsystem. Before I go on, I need to quote documentation:
For temporary local workarounds, libinput reads the
/etc/libinput/local-overrides.quirks
file. Users may add a sections to this file to add a device quirk for a local device but beware that any modification must be upstreamed or it may cease to work at any time.Warning: Model quirks are internal API and may change at any time. No backwards-compatibility is guaranteed. Local overrides should only be used until the distribution updates the libinput packages.
So quirks subsystem is not a configuration API. If you have a problem which can be solved with a quirk, the quirk most likely needs to be upstreamed.
With that said, the following code placed at /etc/libinput/local-overrides.quirks
file helped the OP to get the bouncing-behavior:
[SINOWEALTH Wired Gaming Mouse]
MatchName=SINOWEALTH Wired Gaming Mouse
ModelBouncingKeys=1
The mouse model name is one from libinput list-devices | grep Device
output. For this to work libinput needs to be at least of 1.12.0 version (for OP it worked on libinput 1.15.0).

- 3,702
- 1
- 29
- 36
-
Upvoted. I also think that your comment about what would happen after an update would be beneficial to be included in your answer. A suggested solution (if possible) for this case would be even better! – BeastOfCaerbannog Jan 06 '20 at 14:29
-
2@user3140225 well, I specifically didn't mention how to update libinput, because there's another question/answer on that matter, which OP has used to do the update. And that post has similar comments too. I'm hoping one day there either would appear a PPA for latest libinput or somebody will write an answer on how to do installation via
checkinstall
. But I unforunately can do neither because I don't have Ubuntu (I'm an Archlinux user, and my gf is using Fedora). – Hi-Angel Jan 06 '20 at 14:34
Another way to do this is to execute the following command in terminal
#!/bin/sh
sudo mkdir -p /etc/libinput
sudo tee /etc/libinput/local-overrides.quirks >/dev/null <<ENDHERE
[Never Debounce]
MatchUdevType=mouse
ModelBouncingKeys=1
ENDHERE
Then Reboot your computer
I found this solution on Reddit: Disable double click prevention

- 21
- 7
libinput list-devices | grep Device
, and tell which one is your mouse name? – Hi-Angel Jan 01 '20 at 11:51/etc/libinput/local-overrides.quirks
file has the following content. (if/etc/libinput
directory doesn't exist, create it). Then you need to restart XServer (for example, just reboot). After that, check whether double click started working. If it didn't, try it again with this content (it's same as previous, but with 2 asterisks added). – Hi-Angel Jan 01 '20 at 13:12evemu-record
of the problem (for example, runevemu-record > log.txt
), and share it somehow, through pastebin or whatever. – Hi-Angel Jan 01 '20 at 16:25libinput record
of a non-working double-click – Hi-Angel Jan 01 '20 at 19:22libinput debug-events
I recorded 5 double clicks although it looks like there's only 5 regular clicks. pastebin – Custard Jan 02 '20 at 15:00libinput record
because it says what quirks are currently applied among other stuff. – Hi-Angel Jan 02 '20 at 16:01libinput record
doesn't exist it 1.10) should be working now. 5 double clicks here – Custard Jan 02 '20 at 20:57quirks:
field, which I have on my system just aboveevents:
one (it is empty, but it's there). Maybe it's because you have very old libinput, 1.11.1 was released 1.5 years ago, latest stable is 1.14.3. Anyway, a few questions: 1) Did you name the file exactly as/etc/libinput/local-overrides.quirks
? 2) Did you not add any additional content, such as comments, indentation, spaces around=
symbol? 3) If you runlibinput debug-events --verbose
and make a click with mouse, does it say about debounce aDEBOUNCE_STATE_IS_UP
orDEBOUNCE_STATE_DISABLED
? – Hi-Angel Jan 03 '20 at 00:24git blame
, and I found that the option to disable it was only introduced a year ago. Besides, it seems back then quirks were using another format. Indeed per this blog post by maintainer, the format was changed in 1.12. – Hi-Angel Jan 03 '20 at 00:58libinput --version
displays it as 1.15.0 whilst synaptic package manager still displays the version as 1.11.1-1 however I don't think this will be an issue and if so I can always refer back to the thread I just mentioned. Thanks for the help. – Custard Jan 03 '20 at 20:24ninja install
), thus bypassing the package manager, did you? Because if you did, those files gonna get overwritten on the next minor update of libinput package. – Hi-Angel Jan 03 '20 at 21:49sudo checkinstall ninja -C builddir/ install
. – Custard Jan 03 '20 at 22:29