geekhack

geekhack Community => Keyboards => Topic started by: Aardwolf on Thu, 23 September 2010, 17:47:16

Title: USB to PS/2 connector question
Post by: Aardwolf on Thu, 23 September 2010, 17:47:16
Hi,

A NKRO keyboard can send max 6 keys at the same time to USB, and "infinite" (or 104) keys at the same time to PS/2.

But if the keyboard has only a USB cable, then you can use a USB to PS/2 adapter, and it'll still support the 104 keys at the same time, even though the output is USB.

So the question is:

If the USB standard for keyboards is limited to sending the signal of 6 keys at the same time, how does this USB to PS/2 connector manage to read more keys than that from the incoming USB signal, to be able to create a full NKRO signal to its output?

And why can this little USB to PS/2 convertor do that, but a complete computer not?
Title: USB to PS/2 connector question
Post by: NewbieOneKenobi on Thu, 23 September 2010, 18:05:02
I'm an Arts person, not an engineer, but converters are either complete active converters (they translate the signal) or passive adapters (stuff that doesn't have a chip in, a mere plug). Using the latter kind may give you the ability to use the device but it won't provide a full conversion. For this reason some old PS/2 keyboards won't work with a mere plug adapter.
Title: USB to PS/2 connector question
Post by: Aardwolf on Thu, 23 September 2010, 18:13:55
Quote from: NewbieOneKenobi;225997
I'm an Arts person, not an engineer, but converters are either complete active converters (they translate the signal) or passive adapters (stuff that doesn't have a chip in, a mere plug). Using the latter kind may give you the ability to use the device but it won't provide a full conversion. For this reason some old PS/2 keyboards won't work with a mere plug adapter.


This still doesn't explain how the connector can read more than 6 keys from the USB signal while the computer cannot, though...
Title: USB to PS/2 connector question
Post by: a_fluffy_kitten on Thu, 23 September 2010, 19:20:21
So there's a difference between a physical connection and a signal connection, right?
Title: USB to PS/2 connector question
Post by: ricercar on Thu, 23 September 2010, 19:24:18
the USB driver software in your computer doesn't read more than 6KRO. The keyboard hardware sends the same information regardless of the physical connector.
Title: USB to PS/2 connector question
Post by: NewbieOneKenobi on Thu, 23 September 2010, 20:03:40
Quote from: a_fluffy_kitten;226034
So there's a difference between a physical connection and a signal connection, right?


Yeah.
Title: USB to PS/2 connector question
Post by: Rajagra on Thu, 23 September 2010, 20:23:19
Quote from: Aardwolf;226001
This still doesn't explain how the connector can read more than 6 keys from the USB signal while the computer cannot, though...


It isn't a USB signal. The keyboard is dual-mode, and when you connect via the passive convertor it detects this and works in full-on, port-throbbing PS/2 mode.
Title: USB to PS/2 connector question
Post by: erricrice on Thu, 23 September 2010, 21:55:31
Yup, it's nothing to do with the keyboard or with the actual USB signal.  It's all on the Software end, meaning Microsoft.

Interesting about the DAS and Topres.  Why would they not even allow it to work?  Would that cut costs somehow?  Why do DAS and Topre even care about cost cutting, being two of the more expensive keyboard manufacturers around?
Title: USB to PS/2 connector question
Post by: Moogle Stiltzkin on Thu, 23 September 2010, 22:18:56
Cherry keyboard im looking at and the Filco both can do full NKRO from USB to PS/2 adapter.

Native interface USB.
Title: USB to PS/2 connector question
Post by: Aardwolf on Fri, 24 September 2010, 02:43:57
Quote from: erricrice;226088
Yup, it's nothing to do with the keyboard or with the actual USB signal.  It's all on the Software end, meaning Microsoft.

Yeah well, I don't really use Windows, and the Linux USB keyboard driver seems to cap it at 6 keys too.

I wonder whether writing a driver that supports full NKRO would be possible? Or does the keyboard itself send not enough information to support full NKRO when using USB?
Title: USB to PS/2 connector question
Post by: erricrice on Fri, 24 September 2010, 07:30:44
Well, Kishy says it's a keyboard side problem, and I am inclined to believe him...

But I have heard that with a custom driver it would be possible to have NKRO through USB.

Kishy, care to expand upon your previous post?
Title: USB to PS/2 connector question
Post by: NewbieOneKenobi on Fri, 24 September 2010, 16:30:05
Guys, since we're getting technical here, there's one thing I would like to know about rollover an ghosting: is it just what it is, or does a certain level of rollover (e.g. NKRO) or anti-ghosting (e.g. "extreme anti-ghosting") translate into some degree of precision that could help avoid trnaspositions while typing (in case of very fast typers who don't hit straight from above, like yours truly). Thanks. If we are at it, sometimes I'm under the impression that with one keyboard or the other takes more time for characters to appear on the screen after pressing keys (e.g. slower on my M than on a scissors 'board I also use).
Title: USB to PS/2 connector question
Post by: itlnstln on Fri, 24 September 2010, 16:39:50
NKRO won't help you there; better typing will.  The fastest typers in the world typically use something that's 2KRO.  There are a few isolated instances (Das 3, Filco Zero) where the scan rate was a little too slow, and it could cause transposition errors in rare (synthetic) circumstances, but this has nothing to do with rollover.
Title: USB to PS/2 connector question
Post by: Rajagra on Fri, 24 September 2010, 17:15:21
On one level, NKRO is easier to handle inside the keyboard than 2KRO. With NKRO you don't have to worry which combinations might generate fake key presses. You simply look at what's pressed, and pass on that information to the computer. With 2KRO you have the overhead of working out what might have gone wrong.

However... Problems are introduced by the ability to track large numbers of keys being held down. You need more memory for the controller to keep track of it. Working out which keys were pressed in which order becomes harder, requiring more complicated algorithms. Not a problem so much for PS/2 which simply transmits each key as it is pressed, but if the keyboard is to be USB capable it needs to store the information and combine it into packets to be transmitted when it is polled by the computer.

So it isn't as simple as you first think. Now it's quite possible to do the job right, but not with the cheapest controllers, which have limited memory. And I don't think manufacturers bother. "Good enough" seems to be their motto, even for expensive keyboards. And most of the time they are right. But at least for gaming keyboards, it would be nice if they just did the job right.

Can USB handle NKRO properly? I suspect not, based on how the DAS 3 used trickery to get 12KRO and it didn't quite work out (http://www.youtube.com/watch?v=ryTktJZ7pDc).
Title: USB to PS/2 connector question
Post by: Rajagra on Fri, 24 September 2010, 17:58:02
It's not surprising they don't treat NKRO seriously. Look at the people who build them (http://www.nieman.harvard.edu/reportsitem.aspx?id=100978).
Title: USB to PS/2 connector question
Post by: gator456 on Fri, 24 September 2010, 20:48:25
I think I can shed some light one this subject.  I have been writing my own Teensy based keyboard/mouse controller.

The USB standard sends key presses as a packet.  6 bytes of this packed are for key presses.  Whether one key is pressed or 6 keys are pressed, the same size packet is sent.  Most firmware just limits the max keys pressed to 6 because of the USB standard.  However it does seem possible to write firmware that could send multiple packets if more than 6 keys are pressed.

Note that the modifier keys do not count towards the 6 because they are encoded 1-hot into a modifier byte(modifier = alt, shift, ctrl, win).

The USB standard does seem a little short sighted by using a 6 key buffer.  The human hands can easily press 10 keys.  A 10 key buffer is not that much more overhead than a 6 key buffer.