9 ms·
Keyboard Latency (2017)
- dottedmag 4y agoNeeds (2017)
- michaelteter 4y agoI notice very significant latency with my Moonlander Mk1, but that is most likely caused by the software and fancy layered kemaps I have created. When I use the Moonlander, mainly for development, I end up typing a lot slower but producing the same output. I also have a lot fewer keyboard shortcut contortions, so my hands are happier. Still it feels like we are trying to maximize the wrong thing, especially when writing software. It still feels very low level and mechanical, when the concepts and patterns are pretty well established. We just don't have a great interface for calling those up and making minor adjustments to suit our specific need. I haven't used copilot, but from seeing devs on Youtube who have it enabled, I'm not sure it is the answer. The visual distraction from seeing possible but often slightly wrong solutions appear and then change seems like trading one chore for another.
- Arrath 4y ago> I haven't used copilot, but from seeing devs on Youtube who have it enabled, I'm not sure it is the answer. The visual distraction from seeing possible but often slightly wrong solutions appear and then change seems like trading one chore for another. This feels reminiscent of my experience with most search systems, whether its the start menu in windows or google search: -Type the first two or three letters of what I want What I want appears first in the list -"Oh good", I think as my brain processes that but I still type the next letter as I was already in the process of doing so -Search results change thanks to that letter at the same moment I hit enter -Annoyance -Fin
- michaelteter 4y ago> Search results change thanks to that letter at the same moment I hit enter This happens so often, everywhere - browsers, spotlight, mobile keyboards, etc. When Spotlight is behaving itself, it tends to work really well. But it has bugs (or inconsistent wrong behaviors) that cause it to sometimes suggest web searches instead of the app I was trying to launch. And there seems to be no way to actually, completely disable web search from Spotlight. What does work really well is the JetBrains IDE open-anything search. Not only does it do a good job with normal typing, but if you remember to just type some of the letters of the thing you want to open, in sequence, it amazingly chooses the right one. "ores" -> OrderRefundService.
- rollcat 4y ago> I notice very significant latency with my Moonlander Mk1, but that is most likely caused by the software and fancy layered kemaps I have created. I'm not noticing all that much latency with my Ergodox EZ, but I'm also running QMK master[1] (rather than ZSA's fork via Oryx). It would be useful to note the firmware + revision in these tests. 40ms sounds like a lot of latency for twitchy games like StarCraft II (for which I've extensively customized my layout[2]); while I'm definitely enjoying the improved ergonomics in the game, I'm starting to wonder how much it's actually impacting my performance. [1]: forked to https://github.com/rollcat/qmk_firmware https://github.com/rollcat/qmk_firmware [2]: https://gist.github.com/rollcat/8b8dcd36c0abccf430b4160ad899b879 https://gist.github.com/rollcat/8b8dcd36c0abccf430b4160ad899...
- ajolly 4y agoWould a faster microprocessor help, or is it something more inherent? I'm just starting to get into custom keyboards. Is ZSA's build known to have latency issues compared to QMK?
- rollcat 4y ago> Is ZSA's build known to have latency issues compared to QMK? ZSA is using a patched QMK - they even let you download the exact source for each firmware build they make for you. At the time when I switched to vanilla QMK (that was already some years ago), ZSA were veeery far behind master; running the latest QMK release fixed a couple of issues for me (like hotplugging the halves), so I guess there could be other improvements? No idea really. > Would a faster microprocessor help In the MCU world, latency and clock speed can have a very linear relationship - until they suddenly don't. The microcontroller's job is very simple really: scan the key matrix at a certain frequency, perform key debouncing, compare the current state with the previous, and craft a USB HID packet with key press/release events. So having twice the clock speed could theoretically let you scan twice as often, so it might let you cut the latency in half. Except we have those pesky physics getting in our way! For simplicity let's assume we don't have split halves (where there's an extra serial connection slowing things down); I'm no EE so I only grasp these concepts at the surface level, but signals take time to propagate, and long traces on the PCB (and cables too) have a tiny bit of their own capacitance. (Capacitors are like really fast, really tiny batteries - but they still take a tiny amount of time to charge and discharge, which does all sorts of interesting things to high-frequency signals.) On top of that, the electrical connection that the pieces of metal are making inside the switch, are never perfect at the exact instant the switch is supposed to (de)register: a couple electrons might start jumping over the air even before contact is made, and the physical connection is subject to normal wear, amplifying the "edge case" effect over its lifetime - which all together means we have to actually spend a certain amount of time "looking" at the state of the switch, to let it settle and make sure we got it right. We end up spending so much time letting physics do its job that in a trivial firmware, the MCU is actually spending a significant amount of time... just sleeping. Which means we were later able to cram all sorts of madness like individual RGB lightning or status displays, and never decreased the poll rate. Where would these 40ms come from then? Well I wouldn't get near the problem without an oscilloscope, and unfortunately I don't have one. > I'm just starting to get into custom keyboards. Then I recommend studying the original ErgoDox firmware & build instructions! It's extremely straightforward compared to a beast like QMK, which actually uses a whole RTOS. https://www.ergodox.io/ https://www.ergodox.io/; https://github.com/benblazak/ergodox-firmware https://github.com/benblazak/ergodox-firmware
- lajosbacs 4y agoThis comes up every other day (along with https://danluu.com/input-lag/ https://danluu.com/input-lag/ ) and rightfully so. We need to be reminded of this as long as car and other companies sell stuff like this with a straight face https://youtu.be/bpclpbDmHsw?t=361 https://youtu.be/bpclpbDmHsw?t=361 .
- adolph 4y agoIf the test is between the keyboard and screen "For desktop results, results are measured from when the key started moving until the screen finished updating", then the classic "Transatlantic ping faster than sending a pixel to the screen?" should also be considered: It is not uncommon to see desktop LCD monitors take 10+ 240 Hz frames to show a change on the screen. The Sony HMZ averaged around 18 frames, or 70+ total milliseconds. https://superuser.com/questions/419070/transatlantic-ping-faster-than-sending-a-pixel-to-the-screen https://superuser.com/questions/419070/transatlantic-ping-fa...
- ilyt 4y agoOn other side RPM and speedo looks nice and snappy
- danpalmer 4y ago> Humans can’t notice 100ms or 200ms latency My gut is that there's a lot more to this, and that it's not broadly true. I live in the UK and have worked from Australia a few times, and the latency is around 220ms. When typing over SSH, the latency is very noticeable. Not in terms of pressing a key and feeling lag in it showing up, but in a feeling of sluggishness when typing more than a few words at a time. I also notice this feeling in web apps that use React managed inputs for example. My guess is that while 100-200ms isn't noticeable in one instance, adding that to every interaction in a system that has multiple interactions per second is noticeable. A similar comparison is that I can't detect audio and visuals being incorrectly synced with much less than 200ms precision for individual beeps, however if I watch someone talking on a TV that's 30ms out I can tell something is wrong (even if I can't tell which direction).
- kitsunesoba 4y agoOne place where latency has been felt very obviously for me is the MMO World of Warcraft. I’ve played it for many years from several different geographical locations, with reported latency between my computer and their servers ranging from as low as 20ms to as high as 240. I can pretty reliably tell if I’m playing on a PST or EST (North America) server, with the latter having 50-60ms latency compared to a PST server with 20-30ms due to differences in distance. It’s not massive, but on EST servers everything is ever so slightly less responsive, and it’s particularly visible in combat where many abilities are being used rapidly and outcome is dependent on order of operations. The differences starts becoming obvious when crossing the 80-90ms latency and unmistakable at 120ms+. I would agree that it would be difficult to tell the difference in a one-off test but when it’s something you’re actively doing for long stretches of time it’s easy to pick up on.
- Arrath 4y agoI played WoW on dialup will into the lifespan of WotLK. Average ping in the 320ms range. I learned to play around it to a degree, 'queueing' my spell casts by triggering it when my current one was close to completion, such that the command would hit the server about the time it would complete my previous spell. I could reliably chain cast spells this way once I got used to it, using the order of operations to my advantage as best as possible, as you say. Once I moved and got onto broadband, and found myself with a miraculous 100ms ping, I basically had to learn the game all over again as my instincts would cause me to try to do actions I couldn't yet do, since I wasn't quite done casting a spell, harvesting a node, etc. Later on I changed servers and was below 80ms ping, and the difference was again palpable but not game changing.
- falcolas 4y agoI'd love to see this revisited since Bluetooth has taken over the keyboard and mouse world.
- kitsunesoba 4y agoIt would be interesting to see concrete tests. Gamers have long preferred wired keyboards and mice supposedly for latency reasons, with the only wireless models they’ll accept being proprietary 2.4Ghz RF protocols designed specifically for lowering latency (e.g. Logitech’s Lightspeed lineup). I have a Lightspeed mouse as part of my gaming setup and it does feel very responsive, easily good enough for my needs, but I’m not a chart topping FPS player who’d be pushing these devices to their limits.
- jonpurdy 4y agoI randomly purchased a Logitech G305 (with Lightspeed) to replace my wired B100 (I wanted a mouse with a similar shape). I figured I'd sacrifice latency for losing the wire. Turns out that this mouse feels exactly the same as using a wired mouse to me (not gaming). Lightspeed is absolutely not a gimmick! (I too would like to see tests done with wireless devices.)
- falcolas 4y agoThe big problem I have with bluetooth that wires resolve is the seemingly-saturated 2.4Ghz in proximity to my mac. My mice (logitech MX Master3 and others) have a tendency to fritz out when they're on the other side of my desk from my laptop. Ditto keyboards. It's silly-frustrating. What's funny is my bluetooth headphones work fine the whole time. They generally only freak out when I'm close to a running microwave.
- kitsunesoba 4y agoIt's a bit wild how variable experiences are between users with any flavor of wireless (Bluetooth, WiFi, RF). Over the past 18 years or so they've all been mostly trouble-free for me, save for software weirdness like how Windows 10/11 will cut off the first 0.3-1.5s of audio played to a Bluetooth device, but I've encountered several people over the years that wireless has been nothing but trouble for.
- tosh 4y agoOn the current MacBook Pro models the trackpad feels more precise but afaiu it is just the higher refresh rate of the screen (120 vs 60 hz).
- yalue 4y agoI understand that key travel time is included in the latency measurements to facilitate the camera-based measurement, but wouldn't it make more sense to measure latency purely in terms of electrical signals? For example, measuring the time between the first connection of the circuit in the keyswitch to the time at which the USB packet including the keypress is sent across the wire? This seems like it would be equally possible to test with a second logic analyzer, without relying on a high FPS camera. Many people who use "special" mechanical keyboards are well aware of the actuation points on their keyboards, and understand that there are tradeoffs between travel time, physical feedback, and so on. Put another way, unless you think gently resting your fingerprints on the top of a key should count as a "press", then it doesn't make sense to include the key travel time in latency.
- twobitshifter 4y agoYeah I think so. Relevant quote from the article below. How are the keys being pressed, manually? We could have skipped all this by just knowing key travel time will govern based on his experiment. If you really want to know the fastest keyboards look at what the winners of typing competitions use. >A major source of latency is key travel time. It’s not a coincidence that the quickest keyboard measured also has the shortest key travel distance by a large margin. The video setup I’m using to measure end-to-end latency is a 240 fps camera, which means that frames are 4ms apart. When videoing “normal" keypresses and typing, it takes 4-8 frames for a key to become fully depressed. Most switches will start firing before the key is fully depressed, but the key travel time is still significant and can easily add 10ms of delay (or more, depending on the switch mechanism). Contrast this to the Apple "magic" 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.
- advisedwang 4y agoThe author is concerned about perception of latency. You perceive the time from when you make the decision to press a button to when you see the result. From this perspective mechanical vs electrical is irrelevant.
- 4y ago
- mrandish 4y ago> "It’s not a coincidence that the quickest keyboard measured also has the shortest key travel distance by a large margin." High-end keyboards often have user changeable key switches and there are a hundreds of different switches available, each tuned for a different mix of specified parameters including actuation depth, pressure (force) and many more. Switches made for competitive gamers are generally linear (no click), with light force and very shallow actuation depth. For example, some users love the feel and sound of clicky Cherry Blue switches but they're obviously a poor choice from a latency perspective. On my personal keyboards, I even have different switches installed on certain individual keys (Enter, Spacebar, etc) which have different actuation depth and force. Keyboard geeks and pro gamers can be very picky and precise about their preferred switches and the first step in getting serious about keyboards is swappable switches and key caps. I appreciate the rigorous approach to testing the entire latency pathway but I think the key switch aspect of the chain is already very well specified, characterized and studied and is in the control of users who would value objective latency tests. Personally, I'd be far more interested in tests that measure the latency of the rest of the path after electrical switch actuation. Otherwise, a keyboard manufacturer may have the shortest post-actuation latency but it's invisible to these tests due to being masked by the subjective choice of a non-linear, full travel switch the manufacturer may have chosen due to a "feel" preference. https://dygma.com/blogs/stories/the-ultimate-guide-to-mechanical-keyboard-switches-for-2020 https://dygma.com/blogs/stories/the-ultimate-guide-to-mechan...
- ako 4y agoSounds like the wooting keyboard is something you’d appreciate: hot swappable switches, but no need, as you can configure the actuation points with their software: https://next.wooting.io/wooting-60he https://next.wooting.io/wooting-60he
- tiffanyh 4y ago(2017) post.
- dang 4y agoYear added above. Thanks!
- squarefoot 4y agoThe author assumes that humans can't feel the difference between 100 and 200 ms latency, which is simply not true. When I had to move from gameport MIDI interfaces to USB ones back in the day, I could immediately feel the added latency, which was just a few milliseconds more, not a hundred or worse, but to a musical ear it was clearly noticeable. They also only measure USB and wireless devices (that is, USB and USB+wireless ones, since the dongles use USB) which of course are the main limitations wrt latency. Those keyboards can't beat for example any PS2 based 30 years old keyboard because the PS2 port was essentially an UART directly connected to the system bus, without any of the overhead a complex protocol such as USB would add. To me very low latencies can be obtained with USB too, but that would likely require a total rewrite of the drivers and engineering keyboards to take advantage of low latency drivers just like USB music keyboards do. Edit: please disregard any attribution to the author of the false assumptions about human latency perception; that was a citation from other sources they were also refuting. Thanks to all HNers who corrected me.
- desro 4y agoNo, the author specifically questions that assertion. > "[...] it’s common to hear people claim that you can’t notice 50ms or 100ms of latency because human reaction time is 200ms. This doesn’t actually make sense because there are independent quantities. This line of argument is like saying that you wouldn’t notice a flight being delayed by an hour because the duration of the flight is six hours." Separately, I'm very much in the "can notice sub-50ms latencies," but a lifetime of work in digital audio and video will do that.
- mattficke 4y ago> The author assumes that humans can't feel the difference between 100 and 200 ms latency The author does not believe that, the section you’re referring to is titled “counter-arguments to common arguments that latency doesn’t matter”. If you read the paragraphs that follow you will see a rebuttal to the argument that 100ms is insignificant.
- nemetroid 4y agoThe author certainly doesn’t assume that. ”Humans can’t notice 100ms or 200ms latency” is given as an example of a common claim, and the author gives a counter-argument.
- secure 4y agoFWIW, I couldn’t reproduce the Kinesis Advantage measurement when I did my tests: https://michael.stapelberg.ch/posts/2021-05-08-keyboard-input-latency-qmk-kinesis/#results https://michael.stapelberg.ch/posts/2021-05-08-keyboard-inpu... I got 13.6ms ±21%, Dan writes about 50ms. Maybe we measured different models, the Kinesis Advantage has many revisions.
- lapcat 4y ago(2017) Posted 1 year ago, 114 comments: https://news.ycombinator.com/item?id=28399883 https://news.ycombinator.com/item?id=28399883
- dang 4y agoThanks! Macroexpanded: Keyboard Latency (2017) - https://news.ycombinator.com/item?id=28399883 https://news.ycombinator.com/item?id=28399883 - Sept 2021 (114 comments) Keyboard latency - https://news.ycombinator.com/item?id=15485672 https://news.ycombinator.com/item?id=15485672 - Oct 2017 (265 comments)
- 752963e64 4y ago
- markstos 4y agoI have a couple HHKB Lite keyboards in a drawer I should sell. They topped the benchmarks here just behind the ultra low travel Magic Keyboard.
- adolph 4y agoAccording to iFixIt teardown, Magic Keyboard uses: ST Microelectronics STM32F103VB 72 MHz 32-bit RISC ARM Cortex-M3 [0] This is a step up from the signal processing power of the HHKB's Renesas M38K07M4 [3] or an MS ergonomic keyboard's NRF24. [1,2] 0. https://www.ifixit.com/Teardown/Magic+Keyboard+Teardown/50995 https://www.ifixit.com/Teardown/Magic+Keyboard+Teardown/5099... 1. https://chrispaynter.medium.com/modding-the-microsoft-sculpt-ergonomic-keyboard-to-run-qmk-41d3d1caa7e6 https://chrispaynter.medium.com/modding-the-microsoft-sculpt... 2. https://www.nordicsemi.com/Products/nRF24-series https://www.nordicsemi.com/Products/nRF24-series 3. https://raw.githubusercontent.com/tmk/tmk_keyboard/master/keyboard/hhkb/doc/HHKB.txt https://raw.githubusercontent.com/tmk/tmk_keyboard/master/ke...
- ilyt 4y agoI'd imagine that at minuscule amount of work keyboard needs to do speed of CPU barely matters. As long as chip has USB builtin (and you're not manually bit-banging usb 1.1 out) it's essentially "fill a buffer, send it to USB controller". Now if it has to control keyboard and blink a billion of RGB leds, sure, that helps
- markstos 4y agoYou found the specs for the HHKB Pro, not the HHKB Lite 2. The Lite version costs much less, so I don’t assume they share the same chips. I used the HHKB Lite 2 for about 17 years and had a good experience with it. If there was a latency delay in the hardware, I never noticed.
- markfeathers 4y agoThis post inspired me a few years ago to start a very impractical learning side project. Most keyboards don't overly prioritize latency. Development of a keyboard is easy using a USB stack from the manufacturer, but it might not prioritize latency. I'm working on making my own FPGA based USB 2.0 HID device that will let me minimize any latency in the stack. PCB layout is mostly done, I'm working on a DECA FPGA board to prove out the USB hid software now. I started this pre covid though when Mach XO2s were inexpensive and available, so I have no idea who I will need to fight these days to get parts when I get to that point. There is lots of wiggle room too in how you implement your debounce algorithm to optimize latency too. I'm excited to control the whole stack to try to make this as fast as possible. The Logitech lightspeed products came out after I started this project though and are far more practical for most people. I have one of those at home and will try to benchmark and compare them when I get there.
- NovemberWhiskey 4y ago>There is lots of wiggle room too in how you implement your debounce algorithm to optimize latency too. That doesn't make any sense to me. Debouncing is about preventing inappropriate deactivation, and is unrelated to time to initial activation.
- kangalioo 4y agoI thought it's about preventing inappropriate reactivation? As in, the key slightly bouncing back and forth when you press it, thereby registering two (or more) activations per press
- NovemberWhiskey 4y agoI suppose we should really talk about changes in state rather than activation/deactivation as it's the same problem. But the basic point is that detecting an edge on an "armed" switch is all that's necessary to fire the related event and confirm the state change definitively. The debouncing logic is about how we determine when to re-arm the switch for the next transition - i.e. how to reject the "false" reversions to the prior state. So it shouldn't have any impact on the "physical action to key-down event" latency in systems with a reasonable steady state. I guess for cases where "pound on the same key again and again as quickly as possible" are in scope it does?
- fferen 4y agoIf the major source of latency is key travel distance, does this really impact the user experience? My feeling is that a keyboard with longer travel distance feels more "solid" than one where the key hardly goes down at all, even if this adds some extra latency. Otherwise we could just type on virtual keyboards with zero travel distance, but then there is no tactile feedback when the key is pressed.
- diroussel 4y agoAnother great deep dive into latency of typing is this one [1] which considers input latency from the keyboard, the keyboard interface, the editor/IDE, and even the window manager. Pavel found that Windoes Aero added 16.6ms extra latency (but this has probably been fixed by now). [1] https://pavelfatin.com/typing-with-pleasure/ https://pavelfatin.com/typing-with-pleasure/
- 0xbadcafebee 4y agoI now expect Project Farm to have a keyboard benchmark test using a bullet to trigger the keypress
- cialowicz 4y agoUnless I'm misunderstanding something, I see a possible issue with the experiment setup. > The start-of-input was measured by pressing two keys at once -- one key on the keyboard and a button that was also connected to the logic analyzer. In order to get an accurate measurement, wouldn't you need to directly connect the analyzer to circuitry on the underside of a specific key, as well as the USB output, and measure the diff? The article addresses this by mentioning it's only possible to get average latencies with their setup, but I wonder if this is why the keyboard with the shortest measured latency is also one with an extremely low travel distance.
- taroth 4y agoUp-to-date reviews of keyboard latency: https://www.rtings.com/keyboard/tests/latency https://www.rtings.com/keyboard/tests/latency The Corsair K65 achieved the fastest latency of 0.1ms. By comparison the Apple Magic Keyboard with TouchID had a latency of about 27ms, both wired and bluetooth. Pretty wild that the Apple keyboard is 270x slower! Now I personally use the Logitech G915 TKL, low-profile. The 1.3ms latency is excellent and I love the key feel.
- 323 4y ago> The 1.3ms latency is excellent and I love the key feel. Anyone can explain how is that possible, given that plenty of experiments showed that the human (conscious) reaction time is above 150 ms?
- fredrikholm 4y agoReaction as in responding to an unexpected event? Typing in Vim/Sublime feels instant compared to your run of the mill IDEs. It's painful having to work in those behemoths, esp. considering the fact that I'm literally waiting for them to put text into a buffer. That difference is less than 150ms, and I hate it. EDIT: Here's a video depicting latency. The difference between 10ms and 1ms is monumental. https://youtu.be/vOvQCPLkPt4?t=56 https://youtu.be/vOvQCPLkPt4?t=56
- thefaux 4y agoReaction time and perception time are not the same. I can perceive latency at a much finer resolution than 150ms and find high latency bothersome.
- munificent 4y agoReaction time is a different measurement than perception time. The linked article goes into this. You can absolutely tell the difference between 150ms and 1.3ms. Hell, people can easily tell the difference between a 60 FPS framerate and 30 FPS. That's a difference of only 16 ms per frame.
- markdestouches 4y ago
- uptown 4y agoIt’s not quite ‘latency’ but one keyboard attribute I’ve come to notice is the key “spring-back” time. I’m not sure what that’s called. I recently switched from an older Apple wireless keyboard to a Logitech MX Keys keyboard. The feel is nice but the depressed keys feel like they “bounce back” too slowly for me leading to frequent typos.
- Dave_Rosenthal 4y agoThis whole thing seems so technical and hardware focused. Scan rates, debounce algorithms, USB packets, etc. and then it comes out halfway through the blog post that he's actually largely measuring how long it takes his finger to depress the key! He says that 16-32 ms of the latency ("4-8 frames") is attributed to his finger speed. In other words, he starts measuring from physical contact with the key rather than switch contact. If you're interested in actual hardware latency measurements: https://www.rtings.com/keyboard/tests/latency https://www.rtings.com/keyboard/tests/latency You'll see that the histogram of the keyboards they've tested suggests a bi-model latency distribution. About half tested show essentially no latency (0-3ms) and the other half show 10-15ms latency. There are outliers too, of course, but note that the finger speed measurements dominate these numbers. It seems this post is really about key travel, but in disguise.
- velox_neb 4y agoThis post is why I believe the Apple Magic Keyboard is actually the best gaming keyboard currently available. I noticed it when I tried gaming on traditional mechanical keyboard, and then on an AMK. The Apple keyboard feels distinctly snappier, lets me react faster and take actions in quicker succession. Now when I watch a real-time strategy gaming streamer or something, and hear them clacking furiously at their fancy mechanical keyboard, I wince. They're losing 10-20ms to key travel on every action they take!