(%x)KRO vs True *KRO, quality parameter

ivelegacy

08 Feb 2019, 13:48

KRO stands for key roll over, and it normally goes after a number, e.g. 2KRO means 2 key rollover, and a keyboard has "2 key rollover" *if and only if* it can support 2 keys pressed at the same time no matter when it happens and which keys (META? non-META?) they are.

I have read that most rubber dome keyboards sold these days have 2KRO. This does not, however, limit the number of pressed keys at the same time in all cases, it's the minimal sufficient condition, and it only says that the keyboard is guaranteed to always be able to support (%x) keys at the same time. So, depending on the matrix layout and controller used, two keyboards with the same "2KRO" qualification may behave very differently. Some may always register only up to two simultaneous keypresses, and some will easily register more. In this case, 2KRO might be declared just because there are some key combinations (preferably uncommon) which will prevent some other keys from being pressed at the same time. Since this means there are combinations of three or more keys that can't be pressed together, the company declares just 2KRO.

With the term True *KRO (or NKRO, N=*) the industry means a keyboard that can support any combination of keys (the symbol "*" means "whatever key") pressed together, no matter what.


If the above is correct, is there a way to obtain this information for a given keyboard? This parameter seems good for qualifying both the "key-matrix" and "key-controller" used in a keyboard.


p.s.
I am thinking about reusing plastic film key matrix, used in laptops, but ... they don't have diodes so they might be affected by ghosting.

Anakey

08 Feb 2019, 14:09

In many cases the 2KRO is actually limited by the controller rather then the matrix, if you were to replace the controller with say a Teensy then you may find that you can indeed press 6 keys at the same time and they will register. The controllers themselves will artificially limit simultaneous key presses just to get around potential ghosting issues which could occur if pressing more then 2 keys, although the keyboard matrix itself is actually very good at eliminating ghosting as the row pins will often change several times on the same row so as to avoid ghosting as much as possible. Normally modifier keys are excluded from the roll over given that some routine combinations e.g. Ctrl+Alt+Del would need 3 keys to be detected at once anyway.

Findecanor

08 Feb 2019, 14:33

ivelegacy, you got that right.

The only terms that would be unambiguous in keyboards' official spec sheets would be "2KRO" and "6KRO". Some keyboards that advertise "N-key rollover" have diodes in the matrix but are limited to 6KRO over USB. 6KRO is used because of a simple protocol format that is the most compatible with host software: real NKRO is tricky to achieve without experiencing problems with some BIOS or operating system.

"Anti-ghosting" means only that you won't get key activations for keys that you didn't press, and I have never experienced any keyboard that didn't have anti-ghosting in some form. ;)
Some brands advertise 12KRO or 14KRO but have not counted by the convention: that is often 6KRO.

Some modern keyboards are in the Wiki, with "rollover" as one post in the infobox on the page. If present, It should have been put there by a knowledgeable person.

Findecanor

08 Feb 2019, 14:39

Anakey wrote:
08 Feb 2019, 14:09
In many cases the 2KRO is actually limited by the controller rather then the matrix, if you were to replace the controller with say a Teensy then you may find that you can indeed press 6 keys at the same time and they will register.
That is up to the algorithm used by the microcontroller firmware for detecting potential ghost presses and blocking them.
I think that there are very few keyboards that have a shitty algorithm.
Anakey wrote:
08 Feb 2019, 14:09
although the keyboard matrix itself is actually very good at eliminating ghosting as the row pins will often change several times on the same row so as to avoid ghosting as much as possible.
What are you talking about?
Anakey wrote:
08 Feb 2019, 14:09
Normally modifier keys are excluded from the roll over given that some routine combinations e.g. Ctrl+Alt+Del would need 3 keys to be detected at once anyway.
I think you are confusing things.

Most keyboards have the modifier keys and other keys in the same matrix, but the matrices are often designed in smart ways so as to avoid ghost conditions with modifiers.
Some keyboards do read modifier keys separately, but those are unusual.

Another thing is that the 6KRO USB protocol reports modifiers using a dedicated bit per key, whereas other keys are put as codes in a 6-element array. The modifiers are not counted because they are not part of the array, and thus not limited.

But those are two different things.
Last edited by Findecanor on 08 Feb 2019, 15:05, edited 2 times in total.

Anakey

08 Feb 2019, 15:08

Findecanor wrote:
08 Feb 2019, 14:39
Anakey wrote:
08 Feb 2019, 14:09
although the keyboard matrix itself is actually very good at eliminating ghosting as the row pins will often change several times on the same row so as to avoid ghosting as much as possible.
What are you talking about?
What i am talking about is the difference between say a custom designed pcb or indeed a handwire that is made using long rows spanning the length of the keyboard using the same row pin along the full length with the same number of row pins as physical rows. This is in contrast to many vintage boards and i suspect the vast majority of consumer boards today that will have more row pins then the number of actual physical rows on the keyboard.

Findecanor

08 Feb 2019, 15:25

Anakey wrote:
08 Feb 2019, 15:08
Findecanor wrote:
08 Feb 2019, 14:39
Anakey wrote:
08 Feb 2019, 14:09
although the keyboard matrix itself is actually very good at eliminating ghosting as the row pins will often change several times on the same row so as to avoid ghosting as much as possible.
What are you talking about?
What i am talking about is the difference between say a custom designed pcb or indeed a handwire that is made using long rows spanning the length of the keyboard using the same row pin along the full length with the same number of row pins as physical rows. This is in contrast to many vintage boards and i suspect the vast majority of consumer boards today that will have more row pins then the number of actual physical rows on the keyboard.
Ah. OK. Another way of saying that is that 2KRO keyboards often have a sparse matrix, so as to reduce the number of ghosting key combinations.

It is not just rows. The logical arrangement of the keys in the electrical matrix does not have to reflect the physical layout of the keys at all.
Many gaming keyboards with rubber domes and membranes have very sparse "gaming-optimised" matrices with complex layouts where the WASD cluster and adjoining keys are laid out so that they can't produce ghost conditions with each-other .. but they do block more easily with keys outside that group.

ivelegacy

09 Feb 2019, 14:57

is there any example for the anti-key-ghosting algorithm to be followed in the design of the keyboard controller?

User avatar
fohat
Elder Messenger

09 Feb 2019, 15:19

At least Northgate was nice enough to specify:
Omnikey-PCB-rollover.jpg
Omnikey-PCB-rollover.jpg (341.51 KiB) Viewed 145 times

ivelegacy

09 Feb 2019, 15:46

and, anything that the firmware of the keyboard controller can do?

User avatar
Muirium
µ

09 Feb 2019, 15:57

Rollover is a chain, defined by its weakest link.

Findecanor

09 Feb 2019, 16:04

ivelegacy wrote:
09 Feb 2019, 14:57
is there any example for the anti-key-ghosting algorithm to be followed in the design of the keyboard controller?
The controller firmware should scan the matrix, debounce it and check the result of debouncing against previous state to detect new key presses. When processing each new key press, check if there is another key press on the same row and another in the same column. If there is, then the new key press should be ignored and not produce an event.

BTW. When checking for other key presses, don't check debounced state. Instead, check the reverse: OR together the n recent scans of the matrix.

Post Reply

Return to “Keyboards”