All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ave Milia <avemilia@protonmail.com>
To: "kernelnewbies@kernelnewbies.org" <kernelnewbies@kernelnewbies.org>
Subject: Fixing keyboard chatter in Linux
Date: Sat, 03 Oct 2020 22:15:08 +0000	[thread overview]
Message-ID: <QUq3MMK_YQlS6Atq1q1ghy94c9PwbJlSRd4FX3r8qK29wPbwn_34igJ_UrzUbJRXTGPdej_b-Sy3vkQjux3TJp2SiPjdbtaMNib96V9G7x0=@protonmail.com> (raw)

Hello,

I have a faulty key switch on the keyboard that apparently sends multiple signals upon a single press. And apparently this is called keyboard chatter.

I was not able to find any information on how to fix this via software, nor was I able to find any Linux software that does this. The only information I was able to find was to use commands such as `xset r rate` for Xorg key repeat rate and `kbdrate` for Linux console repeat rate. However, setting e.g. `xset r rate 600 1` (delay before bulk emitting keystrokes: 600 ms, emit keystrokes with speed: 1 per second) did not fix the problem. Logically, it would seem that it targets keys that are already pressed down, based on which it can be reasoned that the computer registers a very fast sequence of key_down key_up events multiple times.

So a naive solution would be to set some time, e.g. 50ms, and then check if the difference (key_up - key_down) is < 50, and if it is, discard the keypress. Please correct me if I'm wrong.

Since no such software exists (or if it does, please share it), I would like to ask for your advice on how to implement this. I more or less know C, but I have no idea where to start on this problem:
* what do I need to know about Linux kernel to solve this?
* at which point of Linux input logic can I put this filter?
* does the filter have to be in kernel mode or it can be in user mode (I'd prefer not to work in kernel mode)?
* do I need to write a special input driver to implement this filter (the keyboard is a USB keyboard controlled by usbhid)?

So, I just need some basic directions and where to start.

Thanks in advance.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

             reply	other threads:[~2020-10-03 22:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-03 22:15 Ave Milia [this message]
2020-10-04  3:54 ` Fixing keyboard chatter in Linux Valdis Klētnieks

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='QUq3MMK_YQlS6Atq1q1ghy94c9PwbJlSRd4FX3r8qK29wPbwn_34igJ_UrzUbJRXTGPdej_b-Sy3vkQjux3TJp2SiPjdbtaMNib96V9G7x0=@protonmail.com' \
    --to=avemilia@protonmail.com \
    --cc=kernelnewbies@kernelnewbies.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.