This Microsoft link gives a basic overview of n-key "anti-ghosting", and provides an online keyboard test (more informative than your test, iMav, sorry). The same online test is also available
here if the first link doesn't work.
The number of scanned codes ("n-keys") varies across different parts of the same keyboard. Basically, the keyboard matrix is bottlenecked by the number of I/O lines in the keyboard controller so design compromises are made. Keyboards are engineered with emphasis (more circuit lines, more logic priority) on the most frequently used keys. Thus, how many simultaneous keys can be pressed is largely determined by where they are located and how they are logically grouped. A few better keyboards use signal diodes within the matrix (sometimes on each key) to bypass many "ghosting" problems, but this is slightly more costly; these often allow fuller software remapping of the key codes/functions.
Most decent USB keyboards focus on the homekeys. All keys within the left-hand (
1234 QWER ASDF ZXCV) and right-hand (
7890 UIOP JKL; M,./) groups will usually scan up to 4 simultaneous codes, although less sophisticated (cheaper) matrices often require these keys are all on the same row, are clustered together, or are immediately adjacent. Particular multikey combinations are simply impossible on some boards.
Function keys are usually logically grouped the same way they are physically grouped;
F1-F4,
F5-F8,
F9-F12. Usually, up to four of these will scan if they are all within the same group. Better keyboards ignore these group boundaries and allow any four (or more) simultaneous F keys, provided they are all adjacent.
Usually any combination of three numbers can be pressed on the Numpad (a common exception is the
369 vertical); better keyboards might allow four or more.
Better keyboards allow all four cursor keys to be simultaneously pressed, some don't.
Editing/Navigation keys are a wildcard, as often grouped into the Numpad matrix as not, so anything between one and four simultaneous keystrokes can be expected.
The
Spacebar,
Shift,
Ctrl,
Alt keys are typically "higher priority" in the logic than other keyscans, and will usually register when pressed (sometimes displacing other keystrokes) no matter how many other keys are also pressed.
CapsLock,
NumLock,
ScrlLock, and
Esc are typically the highest priorities and will displace all other keystrokes. One or both
Alt keys also usually have special mapping to allow numerical code entry.
Sleep,
Wake,
Power, multimedia, browser, productivity, macro, and backlighting keys are all nonstandard and typically use separate logic that is not part of the main key matrices; their functions/macros typically supercede any other keypresses. (The codes these keys generate do generally follow what are now unofficial de-facto standards, they are often hardwired and cannot be remapped.)
Any other combination of keys will typically only register two codes, often just one if the keys are from different logical groups (ie, Qwerty and Numpad combination).
All PC keyboards recognize the
Ctrl-Alt-Del trilogram. Windows-104 keyboards often recognize any number of additional trilograms based around the GUI keys.
Each time a key is pressed it produces a
Make code; when released it produces a
Break code. Technically, each keystroke actually produces two codes. Sometimes as many as four, six, or eight codes if
Shift,
Ctrl,
Alt modifier keys are also used.
Bear in mind that keyboards using cheaper (less capable) controllers will use less sophisticated matrices; there will be more "trouble spots" where simultaneous keystrokes cannot be properly processed. This can result in "lost" keys (which refuse to be registered), "ghost" or "phantom" keys (random/error codes that weren't pressed), or sporadic scanning (which key appears depends on superhuman differences in timing).
The term "anti-ghosting" is more of a marketing gimmick than a useful metric. "n-key rollover" is a much better term, but still not entirely accurate.
USB keyboards appear to have a 6-code limit. I don't know why, though I suspect it is a limitation of the USB HID library (software which translates the USB signals into PS/2 codesets for the host controller). PS/2 doesn't appear to suffer from this bottleneck, although it may still be present on cheaper keyboards.
To complicate matters, most PS/2 and some USB keyboard controllers have a small buffer (typically 16-codes, not the same as 16-characters) which can momentarily hold scanned keycodes until the host is ready to accept them.
Note "cheap" keyboard in this context refers to the electronics within the keyboard; specifically the keyboard controller and the related matrix (circuitry). A keyboard can cost hundreds of dollars, have the finest construction, and the best switches in existence yet still suffer limitations from cheap onboard electronics.
Gaming keyboards which advertise "anti-ghosting" seem to often just reorganize the matrix, relocating "ghosting" problems to where they are less noxious instead of actually resolving them. Most of the focus is within proximity of the WASD cluster, the cursor, and the Numpad keys.
The only keyboards I've personally seen which appear to offer (truly) superior "anti-ghosting" are the SteelSeries 7G and 6Gv2, although I haven't personally tested them (or taken them apart) to confirm.