Linux Input/HID development
 help / color / mirror / Atom feed
From: Adam Nielsen <a.nielsen@shikadi.net>
To: linux-input@vger.kernel.org
Subject: Is it possible to debounce button events?
Date: Tue, 23 Jul 2013 05:38:25 +1000	[thread overview]
Message-ID: <20130723053825.7b6b37a7@korath.teln.shikadi.net> (raw)

Hi all,

In every mouse I have ever owned, as it ages the buttons become less
and less reliable.  Usually this means it starts to send multiple
button press events each time the button is clicked.  The Logitech
mouse I am currently using is now producing double-clicks about 10% of
the time when I only press the left button once.

Rather than replace an otherwise perfectly working device, or
disassemble and clean the switches (again), I am wondering whether
there is any sort of debounce option in the input subsystem.

I am looking for some setting where I can tell the input subsystem to
ignore button-press/release events if they occur within a configurable
amount of time after the initial event, e.g. 10 milliseconds.

This would be quick enough that it would not interfere with intentional
double-clicks, but unintentional double-clicks would be eliminated.

It looks like a few input drivers internally implement debouncing, so
I'm wondering whether there is a generic mechanism that can be used for
any button on any input device?

Many thanks,
Adam.



                 reply	other threads:[~2013-07-22 19:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130723053825.7b6b37a7@korath.teln.shikadi.net \
    --to=a.nielsen@shikadi.net \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox