Hacker News new | ask | show | jobs
by toopsss 2881 days ago
Debouncing shouldn’t add any latency. If a mechanical keyboard sold at a price premium adds latency for “denouncing” someone got ripped off.
1 comments

Debouncing does add latency how much is dependent on the switch and matrix type as well as the controller.

Debouncing isn't limited to keyboards this is a concept in electronic switching.

http://www.labbookpages.co.uk/electronics/debounce.html

The method of debouncing (software, hardware or both) as well as the "debounce" window which can be set beyond a certain base limit to an arbitrary value has an impact on latency.

"Gaming" keyboards that tend to push the limit of what is acceptable for debouncing like the first generation Razer ones have had issues with keys registering multiple times for a single press.

Most current keyboards don't use the first "drop" as a keypress and usually count 2-3 drops depending on the switch type, and then also have their window set for key repeat if the key is still pressed which then adds additional latency.

Heck even with "normal" keyboards you can sometimes see this in action while keeping a key pressed you might notice that the repeat typing is sometimes jittery that is usually the debouncing in action.

The reason why mechanical switches can be worse off than membrane is because of how the electrical contact is made.

it's a 'common' (I've at least seen it used in various open-source keyboard firmwares) trick to only debounce the key release; if you think about it, there's no reason to wait to report the key press, so debouncing should not add latency.
This technique is highly susceptible to noise. I had implemented this in a prototype game controller years back to get latency down and it was plagued by phantom keys when people physically bent the PCB.
There is a reason because many mechanical switches can be partially actuated, spark and depending on the matrix you can also have cross talk which why you need to wait to make sure it’s an actual key press not the switch just ratteling or some noise on the same line.
So what's the best keyboard with the lowest latency?: usb>ps/2 some mecha>membrane? How can a consumer tell which is the better choice? input lag of the different keyboards on the same machine?
Switches with high actuation point will have inherently lower latency (measured from the start of the keypress). Check deskthority wiki for the numbers, they should have most mainstream switches listed.

Benchmarking the time from switch activation to the computer being aware of the input should be doable (i.e. ignoring display latency and most of the software stack), alas no tech reviewers I know of do it. So no easy way for a consumer to compare products. IIRC someone measured the Wooting One to have ~4ms of latency. It does have a switch with adjustable actuation point (not so useful if you get the clicky version, since you cant adjust the tactile bump and click).

Edit: By high actuation point I mean farther from the board, it's usually specified from the start of the key travel, so lower numbers.

yeah that made sense from the start, thanks for the info!