Live data from Hacker News

Keyboard latency

danluu.com

71–80 of 274 posts

Re: Keyboard latency

#71

Isn't a big part of the reason "gaming" keyboards cost so much because they can register more than three keys (sometimes four) being hit at the same time - something many cheaper keyboards cannot do due to the way they are wired?

Yes, n-key rollover sometimes comes up. In practice, I've only had it become an issue in the wild either when more than one player is sharing the keyboard or, in some rare games, primarily simulators, where you might need to hold multiple keys.

Re: Keyboard latency

#72
post #37

Earlier quoted context omitted.

That's fine though. It's about the experience end-to-end. I love the apple keyboards. I still type faster on them than other keyboards, including high-end mechanical keyboards. The short keys and actuation feel responsive, yet I've never felt like I've accidentally triggered a key.

Agreed, and I don't understand the hate many people (seem to) have for them - the most ergonomic keyboards are those that require the least amount of repetitive motion. Not that there isn't an adjustment period, but some seem to pull out their Jump To Conclusion mats a little early.

"the most ergonomic keyboards are those that require the least amount of repetitive motion"

Not sure I can agree with that. I was using one of the Apple keyboards for quite a long time while running liveops on an online game (which meant rapid response whenever incidents happened, jumping into shells and constantly typing like my life depended on it), and developed fairly severe wrist problems within a couple months. To the point where I almost had to leave the job on disability, per my doctor's orders.

On the recommendation of a friend, before taking that step I tried switching to a Kinesis Advantage for the better wrist alignment and less "hard" keystroke bottom as compared to the chiclets on the Apple keyboard. It was a bit of a learning curve (~2 weeks to get up to full typing speed when using it every day, a couple more to push past it), but at the end of it my wrists got better almost instantly, and I never had problems again. My typing speed went up as well.

I'm not sure how much of that improvement is due to the better alignment of keys (there's almost no hand movement when typing, and your wrists are always neutral) and how much is due to the bigger key action and softer bottom, to be fair.

Edit: it's worth mentioning that I'm also a boxer and a piano player, so my wrists take a lot of abuse on a regular basis. YMMV and if you're not having problems, I definitely found the Apple keyboards to be very easy and fast to use.

Re: Keyboard latency

#73
post #48

Earlier quoted context omitted.

the article specifically states the reasons for why he messured the whole travel, no guesswork needed > This is because, as a human, you don’t activate the switch, you press the key. A measurement that starts from switch activiation time misses this large component to latency.

If you game on a mechanical keyboard, you've pretty much worked out exactly where the switch points are and will be working the keys in a fashion different to normal typing. So I'm not quite buying the way the measurements were made vs the purpose of the tests.

Do you really press every possible key down almost to the switch point, and then when you want to actuate the key, press it a tiny bit further?

I would guess (and maybe I'm wrong about this) that you rest your fingers on the keycaps, and press them in as far as needed to actuate, but no further. The key still needs to travel.

Re: Keyboard latency

#74
post #62
post #51

Earlier quoted context omitted.

Or a good enough machine so that you never dip below native framerate.

Even so you would never use vsync as it will introduce input lag in most gaming engines.

Most competitive players will have their own configs for competitive play etc. I have tournament/LAN configs, online play configs, and my video settings mostly stay the same. All tuned for lowest latency and highest visibility.

Re: Keyboard latency

#75
post #11
post #2

IMO, a better measure would be from activation of the switch, as opposed to the beginning of key travel. I don't start waiting for the character to appear on my screen from the moment I begin to press down. My anticipation begins when I feel the tactile feedback of the switch activating (or the switch bottoming out on switches that don't offer tactile feedback). On a keyboard with good tactile feedback, I might not m…

I wouldn't be surprised if the Apple keyboard is the fastest just because it has very shallow keys.

Quoth the fine article:

> Contrast this to the Apple keyboard measured, where the key travel is so short that it can’t be captured with a 240 fps camera, indicating that the key travel time is < 4ms.

Re: Keyboard latency

#76

Earlier quoted context omitted.

Doesn’t the micro controller in the keyboard still scan, and then send a ps/2 signal?

Most mechanical PS2 keyboards are a diode cascade. You pressing the key triggers a wave of electricity cross the keyboard which is converted into the PS2 waveform, and pumped out at the same rate of the incoming clock waveform. OLD PS2 keyboards don't generally have internal digital micro-controllers, they're effectively analog, the logic they do contain is blindly simple. This is why some struggle with N-Key Rollove…

I am having a very difficult time believing this.

- I cannot find about "diode cascades" having anything to do keyboards. The closest is the usual diode matrix to deal with simultaneous key presses.

- The PS/2 interface involves sending scan codes, parity bits, and start and stop bits. How exactly does a "wave of electricity" get converted into a PS/2 waveform without some digital electronics?

- All the old schematics for mechanical keyboards I could find were the usual matrix scan. Even a textbook from the 1970s.

Anyway, reference please. I'd find it very interesting to see how such a thing would work.

Re: Keyboard latency

#77
post #58
post #46

Earlier quoted context omitted.

That's effectively providing a definition of the latency he's discussing, not an explanation of why that's the sort of latency he finds interesting. But I see he does goes on to say that he cares about game performance, rather than typing experience: « If, for example, you’re playing a game and start dodging when you see something happen, you have pay the cost of the key movement, which is different for different key…

Seasoned gamers preload keys they are anticipating to use. On my keyboard I have less than a millimeter of travel from the preloaded point I use (which is right in front of the tactile bump and is quickly trained) to actuation. In tacticale switches the bump and the making of the contact are mechanically connected. Using the moment of finger/key contact quite obviously selects for travel, among other things.

>In tacticale switches the bump and the making of the contact are mechanically connected.

Nope! This is rarely (if ever?) the case. In alps switches, for example, there are two totally separate leafs, one of which handles the tactile feeling and the other of which is responsible for the actual actuation. If you browse through Haata's Plotly[1] you can see that many switches actuate well after the tactile bump. Though they are often pretty closely related in terms of their depth in the keypress, they are wholly unrelated from one another mechanically.

[1] https://plot.ly/~haata

Re: Keyboard latency

#78
post #56
post #38

Earlier quoted context omitted.

>So even if you got your keyboard down to 5 ms, great, but you are not running an operating system that can reliably do something within that timespan! Maybe I'm not understanding, but that doesn't seem correct. Most people (gamers) are running mice at 500/1000Hz polling rates and you can easily verify the movement made in each 1-2ms update. (And it is most definitely a noticeable difference going from a standard 125…

Don't confuse throughout and latency. The mouse may be measuring and sending data every 1-2ms, but that doesn't say anything about the latency before the data is handled.

This is also a pretty important point: most monitors refresh at 60hz anyway even if your game seems to be measuring much higher framerates, so there's a worst case floor of ~17s on just visuals lagging behind input because you're waiting for the next screen refresh anyway.

The mouse measuring data every 1-2ms will increase the quality of the motion tracking, but it won't necessarily help you with latency unless the data gets to the game fast and the game handles the data quickly.

This explanation by John Carmack comes to mind... it's a good reminder against a lot of the hardware fetishism that is mixed into otherwise good advice about gaming setups. https://superuser.com/questions/419070/transatlantic-ping-fa...

Re: Keyboard latency

#79
post #7
post #2

IMO, a better measure would be from activation of the switch, as opposed to the beginning of key travel. I don't start waiting for the character to appear on my screen from the moment I begin to press down. My anticipation begins when I feel the tactile feedback of the switch activating (or the switch bottoming out on switches that don't offer tactile feedback). On a keyboard with good tactile feedback, I might not m…

I agree. Presumably he measured it the way he did because it's easier to measure, rather than because he thinks it's the more meaningful way. (Though maybe his way is more useful if he's interested in whether a keyboard gives an advantage in gaming, rather than whether it's pleasant to type with.)

If you want a clear point, then why not use the moment it bottoms out. So when key travel ends, instead of when key travel starts. In most cases, it'll be much closer to the actual activation. If you want to be even more thorough, publish both times (which you can get from a single video).

Re: Keyboard latency

#80
post #59
post #26

Has anyone benchmarked the keyboard latency of recent generations MacBook Pro Retinas?

I don't have a way to measure raw USB events, but it takes around 90 ms between me pressing a key on the Macbook's (2015 model) keyboard and a character showing in the TextEdit.app.

Some of that is surely in the OS and display however. I wonder how you'd go about measuring the latency of a laptop keyboard?
Post reply on HN