Live data from Hacker News

Keyboard Ghosting Explained

microsoft.com

41–50 of 99 posts

Re: Keyboard Ghosting Explained

#42
post #38

I am always amazed that keyboards still do this. We have scanning matrices because back when I was a new engineer pins on a microprocessor were both expensive (larger packages) and they required more gates in the CPU (more expensive CPU) or chip doing the scanning. Today transistors are free and surface mount BGA packages can put down a lot of pads pretty simply[1]. So your typical 104 key keyboard could actually hav…

This is funny because the first keyboard I had, back in the 386 days (1992 I think), didn't had this problem. I remember playing two player games on it without any "ghosting". The keyboard was very solid - hard plastic keys and metal backplate. It was nearly indestructible. Even though new keyboards appeared over time, we still used this one for about 12 years, particularly because that all new keyboards had this gho…

The main issue is cost, as always; the keyboards from that era (IBM Model M and such) cost $100-$150 at the time, which would be even more nowadays. The hardware in those was much more as you'd expect it to be. The technique described in this article is much simpler to make, requires no soldering, etc.

You can splurge on a more expensive keyboard (I have a Filco Majestouch at home) that don't use this cheap techinque and have a much better feel.

Re: Keyboard Ghosting Explained

#43
post #11

> The internal electronics on the SideWinder X4 use a variant of resistive multitouch technology. Each key has a screen printed resistor in series with its switch. This allows the internal electronics to read the state of each key switch independently for very large multiple-key combinations. This is pretty vague. How exactly does this disambiguate which keys are being pressed?

The resistors change the voltage of the resulting signal. So the Microsoft keyboard probably checks whether the circuit is closed and the voltage to determine which keys are actually pressed.

The idea is that by using resistors (which are much cheaper than diodes), any "indirect paths" that go through more than 1 switch between the rows and columns will decrease the voltage sensed on those, while the voltage on the ones that go through only 1 switch is higher.

They say they've patented this technology but in fact it's been used for (smaller) keypads with microcontrollers for a long time before that; I remember reading some application notes that showed this technique.

Re: Keyboard Ghosting Explained

#44
post #32
post #8

Fun Fact: The standard USB keyboard protocol can't handle more than... 6? non-modifier keys being pressed at the same time. IIRC, to get past this, all you need to do is emulate a hub with fifteen or twenty keyboards attached. Then you can press every key at once!

Not true. A USB keyboard must declare the number of simultaneously pressed keys it is able to report. It just happens that the example descriptor included in the USB spec has this value set to 6.

'USB spec'- so it's up to the keyboard driver your operating system provides to actually set the limit?

And other than that, there's no artifact of the protocol that would hinder the development of such support?

Re: Keyboard Ghosting Explained

#45
post #35
post #18

I'm surprised the term "rollover" wasn't referenced here. Is it nonstandard? https://en.wikipedia.org/wiki/Rollover_(key)

The explanation is for the layman. They probably didn't want to use a technical term.

Wouldn't want to confuse the user with references to non-microsoft-sanctioned documentation.

Re: Keyboard Ghosting Explained

#47
In the high school computer lab, after I showed my friends how to disconnect from the Novell network so our instructor couldn't watch what we were doing, we used to play a very good Street Fighter 2 clone. I quickly learned all about keyboard ghosting and used it to my advantage to block my opponent from blocking my attacks.

When I tried the same tactic on my computer at home, I discovered it didn't have the same problem. The chords that were unrecognizable at school worked just fine on my keyboard at home. I surmised that the difference was in how the keyboards detected the key presses.

Over the next few days/weeks I wrote a program that could actually inspect the key queue in memory and mapped out the chords which would fail. I could actually map out what appeared to be groups of keys that caused this problem. I did the same thing for the keyboard I had at my house and while there were some combinations that would lock up the keys, I found that it could handle many more simultaneous keys.

Maybe it wasn't so surprising that the next year I started my EE degree?

Re: Keyboard Ghosting Explained

#48
post #38

I am always amazed that keyboards still do this. We have scanning matrices because back when I was a new engineer pins on a microprocessor were both expensive (larger packages) and they required more gates in the CPU (more expensive CPU) or chip doing the scanning. Today transistors are free and surface mount BGA packages can put down a lot of pads pretty simply[1]. So your typical 104 key keyboard could actually hav…

This is funny because the first keyboard I had, back in the 386 days (1992 I think), didn't had this problem. I remember playing two player games on it without any "ghosting". The keyboard was very solid - hard plastic keys and metal backplate. It was nearly indestructible. Even though new keyboards appeared over time, we still used this one for about 12 years, particularly because that all new keyboards had this gho…

Which is funny to me because I remember playing Asterax on my Quadra running system 7.1 or something, and my friend Reid and I yelling at each other "stop turning! I need to go forward!" or vice versa.

Nowadays I can't imagine buying a keyboard that shares the same technical limitations. I would consider it ... I don't know, disrespectful to my 12-year-old self, that 20 years later I'd still be dealing with the same dumb problem.

Re: Keyboard Ghosting Explained

#49

I am always amazed that keyboards still do this. We have scanning matrices because back when I was a new engineer pins on a microprocessor were both expensive (larger packages) and they required more gates in the CPU (more expensive CPU) or chip doing the scanning. Today transistors are free and surface mount BGA packages can put down a lot of pads pretty simply[1]. So your typical 104 key keyboard could actually hav…

> However, because this requires printing a circuit board with over a hundred diodes, it is relatively expensive.

So we can stick millions of transistors on an integrated circuit, but a hundred diodes? Too difficult!

Re: Keyboard Ghosting Explained

#50
post #23
post #8

Fun Fact: The standard USB keyboard protocol can't handle more than... 6? non-modifier keys being pressed at the same time. IIRC, to get past this, all you need to do is emulate a hub with fifteen or twenty keyboards attached. Then you can press every key at once!

Yup. I'm using a Das Keyboard, and can only get six keys at a time on their applet. One way some people get around this is by using PS/2.

I use a Noppo Choc Mini and it does n-key rollover over USB. It works well but the numpad function won't work on linux for some reason. I also heard it makes the keyboard not function with certain BIOS/operating systems.

Quite frankly I really don't care for n-key rollover, it's a silly marketing argument as far as I'm concerned. 6 KRO without ghosting "ought to be enough for anybody", especially if the alternative breaks compatibility. Maybe the hardcore gamers will disagree though.

Post reply on HN