How does a USB keyboard work?
Why Hacker News recommends it
HN commenters recommend it as a clear, comprehensive explanation of USB signaling and keyboard polling.
What it is
Ben Eater explains how a USB keyboard communicates, covering the electrical interface, bit and packet encoding, packet contents, and a comparison with PS/2.
Recommended by 7 HN commenters across 6 different months, 2021 to 2025.
What Hacker News said
Strong rec jordibc · 2022-03 · on “The end of the nice GTK button”
About the USB keyboard, that may be true only for the cheapest keyboard you could find, but basically not applicable anymore nowadays. Rather than giving you the details, let me link to this video, which is awesome at explaining it and much more -- the USB vs PS/2 part starts here: [this video]
Strong rec ericbarrett · 2024-11 · on “Only buy a magnetic keyboard for gaming”
Among other things, the USB host polls the keyboard at a fixed rate. Fantastic breakdown if you have 30 minutes: [this video]
Recommends wmwmwm · 2021-09 · on “Keyboard Latency (2017)”
There’s a great video here that goes through all this - the gist is that USB keyboards specify what polling rate to use, 1000hz for the best ones, maybe 125hz for the cheaper ones. An interesting thing about ps/2 is that even though it doesn’t have to wait for the keyboard to poll it transmits data at much slower speed than USB (khz vs mhz) which somewhat offsets the advantage it gets from being interrupt driven [this video] edit: ah, sorry, I see someone's posted a link to this video already!
Recommends exporectomy · 2021-09 · on “Keyboard Latency (2017)”
Apparently [1] PS/2 limited by a slower data rate than USB 2.0 which cancels out almost all the advantage of its lower initial latency to begin the transmission, making them both about equally capable in actual latency - at least in theory. [1] [this video] Even if this conclusion is wrong, that video is a very pleasant and understandable explanation of the USB protocol.
Recommends throw0101a · 2021-11 · on “What is AT&T doing at 1111340002?”
> Embedded programming? Dealing with signals?! God forbid, man. "How does a USB keyboard work? by Ben Eater: * [this video]
Recommends jai_ · 2022-06 · on “How to Make Rust Leak Memory (Also: How to Make It Stop)”
If you're interested, here's a really comprehensive video on how USB keyboards work which may answer your question: [this video]
Recommends lozenge · 2022-09 · on “Ask HN: How do I write a Linux driver for my 15 year old photo printer?”
Ben Eater has some videos showing the USB protocol on an oscilloscope. [this video] [LINK] And some videos on using chips and breadboards to meet protocols- [LINK] And a digital protocol too- [LINK]
Cites thristian · 2021-07 · on “How does USB device discovery work? [video]”
Piggy-backing this comment to add some context for the OP video: This "USB device discovery" video is actually the latest in a series of videos where Ben Eater is building a simple 8-bit computer on breadboards. He hooked up a PS/2 keyboard as an input device, and then got sucked into a tangent of investigating and explaining keyboard protocols. - He investigates the PS/2 keyboard protocol: [LINK] - Somebody on Patreon asked about USB keyboards having higher latency than PS/2, so he made a video about the basic USB protocol: [this video] - He made the OP video about USB keyboards being limited to holding six keys at once.