Kernel Newbies Archive on lore.kernel.org
 help / color / Atom feed
* Fixing keyboard chatter in Linux
@ 2020-10-03 22:15 Ave Milia
  2020-10-04  3:54 ` Valdis Klētnieks
  0 siblings, 1 reply; 2+ messages in thread
From: Ave Milia @ 2020-10-03 22:15 UTC (permalink / raw)
  To: kernelnewbies

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Fixing keyboard chatter in Linux
  2020-10-03 22:15 Fixing keyboard chatter in Linux Ave Milia
@ 2020-10-04  3:54 ` Valdis Klētnieks
  0 siblings, 0 replies; 2+ messages in thread
From: Valdis Klētnieks @ 2020-10-04  3:54 UTC (permalink / raw)
  To: Ave Milia; +Cc: kernelnewbies

[-- Attachment #1.1: Type: text/plain, Size: 1128 bytes --]

On Sat, 03 Oct 2020 22:15:08 -0000, Ave Milia said:
> 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.

> 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 key
>   board is a USB keyboard controlled by usbhid)?
>
> So, I just need some basic directions and where to start.

Step 0:  Decide if that amount of effort is even worth it rather than just
replacing the keyboard.

Step 1: Design your software solution to be able to deal with multiple wonky
keys, because if one is broken, there's probably others that are going to give
out soon.

[-- Attachment #1.2: Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-03 22:15 Fixing keyboard chatter in Linux Ave Milia
2020-10-04  3:54 ` Valdis Klētnieks

Kernel Newbies Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \
		kernelnewbies@kernelnewbies.org
	public-inbox-index kernelnewbies

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git