Partial debounce failure on keyboard keys - Page 1
Forum section: electronics / general

author: e100
author_rank: Frequent Contributor
timestamp: July 05, 2023, 01:02:00 am
content: Several of the keys on my computer keyboard sometimes generate 2 key press events when pressed once.Does anyone know how modern keyboards do their debouncing?I assumed it would all be done inside the keyboard controller chip and therefore I don't understand why only some keys are affected and not all keys.

author: RoGeorge
author_rank: Super Contributor
timestamp: July 05, 2023, 06:52:05 am
content: Yes, all debouncing and key codes generating are done on the keyboard side, not on the PC.Try opening the keyboard and clean it, maybe some liquid was spilled. Depending on the model, some keyboards have sheets of membrane contacts that can be peeled apart for cleaning.

author: Bryn
author_rank: Regular Contributor
timestamp: July 05, 2023, 08:18:39 am
content: I had a similar problem with my tablet keyboard, only that it affected the space bar only and most times when I press that it would do several key press events at the one time (even down to the space bar being stuck as a result). I simply threw it out though...Should also say that the "i" key on my laptop keyboard would sometimes trigger two press events at once but strangely was during the early days I had this laptop and since then had used an external keyboard from my old computer - and still going strong 14 years since I first got it.

author: SiliconWizard
author_rank: Super Contributor
timestamp: July 05, 2023, 08:35:36 pm
content: So yes, the debouncing is done in the keyboard's firmware.If you suddenly get multiple key presses for one press, it basically means that the corresponding keys are bouncing for a longer time / slower than normal, which makes the integrated debouncing ineffective.Reason is likely that the keys are either sticky (from accumulated dirt, liquid, etc) or just plain worn out - which would require a replacement.You'll have to figure out if this is a membrane keyboard or a "mechanical" one. If this is a membrane keyboard and some basic cleaning doesn't help, unfortunately there's nothing much you'll be able to do except replacing the membrane (if you can even find a replacement.) Probably not worth the trouble compared to buying a new keyboard.

author: thm_w
author_rank: Super Contributor
timestamp: July 05, 2023, 09:27:44 pm
content: What is the model number of the keyboard?While debouncing is done in the kb as mentioned above, very high polling rates might make key bounce worse. So if it is a high end keyboard, maybe some small chance you could try adjusting that before cleaning it.https://www.clickspeedtester.com/keyboard-latency-test/mx red key switches (linear) seem to be worse than a blue or brown (tactile) for this.

author: sopheadave
author_rank: Newbie
timestamp: April 16, 2024, 08:30:42 pm
content: The issue could be due to dirt or debris under the affected keys. Try gently cleaning the affected keys with compressed air or a keyboard cleaning tool for proper testing and fix.Edit: spam link removed

author: floobydust
author_rank: Super Contributor
timestamp: April 16, 2024, 09:46:25 pm
content: I've seen keyboard problems due to cracked solder joints to switches (Cherry style)- inspect the PC board for bad connections, to the MCU as well. Resolder the problem switches, or swap them with lesser used switches.Food/hair inside membrane style switches can make them malfunction as well.There are many different S/W debounce algorithms out there, some better than others. A small glitch can be ignored or taken as an entirely new key press event.

author: wraper
author_rank: Unknown
timestamp: April 16, 2024, 10:07:01 pm
content: Quote from: e100 on July 05, 2023, 01:02:00 amThey do it in their shitty broken MCU firmware that makes it fail either because they sacrifice proper debounce for response time or programmers don't know what they're doing in regards to how switches operate/bounce (I suspect both). At least from what I've seen on this forum people usually want to register button press only when contact totally settles which is quite lame considering that first appearance of conductivity (in most common normally open switch) means that for sure button is in pressed position, and the only thing you really need to debounce is button release (that it does not make a contact at all for a long enough time, as contact does not bounce in released position). Like really, if firmware is done well, you can make it work even if contacts never settle and make electrical connection only 1/5 of the time during the time button it pressed. As a bonus, for example, Logitech does not care about providing anywhere near to reasonable wetting current in their keyboards and mice. All combined with shitty switches which often do not even have a half-decent silver plating, not to say gold.QuoteBecause keys do not bounce equally.

author: amc184
author_rank: Regular Contributor
timestamp: April 17, 2024, 02:39:54 am
content: I've had switches in mice where the failure mode was that the button would send out multiple impulses per click, which wasn't suppressed by the mouse's deboucing. I think I replaced the main switches in the mouse twice before I retired it for a new one (it had rubber soft touch parts that were getting goey). There was no other issues - no cracked solder joints, no contamination, just wear.Of course these mouse switches were a bit different to a keyboard, I'm just saying that this could be down to wear and tear only. Are the affected keys ones that see more use, say W, A, S and D if you're a gamer?