最大同时按键数 (N键翻转,NKRO,按键冲突) (2010)
Max Number of Simultaneous Key-Press (N-Key Rollover, NKRO, Ghosting) (2010)

原始链接: http://xahlee.info/kbd/keyboard_n-key_rollover_key_ghosting.html

## N键连打与按键冲突:总结 N键连打 (NKRO) 定义了键盘能够准确记录的同時按键数量。标准键盘通常具有6键连打,限制了同时输入。完全NKRO意味着*任意*数量的按键都可以被按下并正确记录。 **按键冲突** (Key ghosting) 发生在键盘由于内部电路的限制而错误地记录按键时。为了对抗这个问题,一些键盘具有“防冲突”技术——通常是一种软件解决方法,例如微软的SideWinder X4,它可以报告高达26个同时按键——但这并非真正的硬件NKRO。 大多数键盘使用按键下方的网格系统来降低成本,这可能导致在同一行或列的按键被按下时发生按键冲突。虽然USB *可以* 处理完全NKRO,但许多默认限制为6键。较旧的PS/2连接通常支持完全NKRO。 完全NKRO对于特定应用至关重要,例如速记、盲文输入和高级游戏,在这些应用中,复杂的按键组合很常见。测试键盘的连打能力很简单:同时按住两个Shift键,然后尝试输入其他字母——如果有些字母没有被记录,则存在按键冲突。

这个Hacker News讨论围绕着**机械键盘的N键无冲 (NKRO)**——同时按下多个按键并被正确识别的能力。 一位使用高端HHKB Pro 2键盘的用户注意到偶尔出现“连键”(重复按键,例如两个字母都变成大写),这可能由于其较低的125hz轮询率和蓝牙连接所致。其他人纷纷发表意见,质疑为什么追求精确度的人会容忍这种情况,将其比作一款略有不准确的高端手表。 对话延伸到旧游戏中使用的按键绑定工具的历史,以解决类似问题,以及快速按下某些按键组合的挑战。最后,一篇详细的帖子重点介绍了使用nRF52840和ESP32S3等芯片以及霍尔传感器按键的先进键盘设计,可能实现40多个同时的模拟输入——这是传统NKRO限制的重大飞跃。
相关文章

原文

By Xah Lee. Date: . Last updated: .

What is n-key rollover?

N-key rollover (NKRO) is the number of simultaneous key presses a keyboard can register.

6-key rollover means a max of 6 keys can be pressed simultaneously. Full n-key rollover means the keyboard can correctly detect any number of simultaneous key presses.

What is key ghosting?

key ghosting is when multiple keys are held down but the wrong keys are registered.

What is Anti-Ghosting Tech

Some gaming keyboards, such as Microsoft Sidewinder (year 2010) , have so-called “anti-ghosting” tech. Basically, it's a scheme to let you press many keys simultaneously, but is not real hardware NKRO.

Unlike partial anti-ghosting solutions which have many combinations of 3 keys which do not work, Microsoft's SideWinder X4 features multitouch technology that allows it to detect, and report ANY combination of QWERTY keys, up to 17 keys. Additionally, it can report 7 modifier keys, 1 hot key and 1 macro key, bringing the maximum number of reported keys to 26. See the SideWinder X4 Anti-Ghosting FAQ for more information.

Microsoft SideWinder X4 Anti-Ghosting FAQ @ http://www.microsoft.com/appliedsciences/content/projects/SideWinderX4.aspx

Test How Many Keys Can Your Keyboard Register

Hold down both left Shift key and right Shift key, then press x. See if the letter shows up on your screen.

Yes? Now, try other keys, while keep both the Shift keys depressed. Go through the whole alphabet. Best is to ask your friend to help you hold both the Shift keys down.

On my Microsoft Comfort Curve Keyboard 2000 and Natural Ergonomic Keyboard 4000, when both Shift are held down, the key x and / and 3 do not work!

On my Apple iMac keyboard M2452 (year 1999), all the top row {Q W E R T Y U I O P [} does not work, except ] and \.

On my Apple keyboard A1048 (year 2003), same result.

N-key rollover, Key Ghosting, Keyboard Switch Circuit Design

The issue is rather complex. It has to do with cost-saving design of the circuit, and also the keyboard interface protocol (e.g. USB).

Ideally, each key is a electronic switch. When a key is pressed, a signal is send for that key. This is logically simple, but it is a expensive way to design the circuit.

Instead, the electronics of the keys are laid out on a rectangular grid. When a key is pressed, it connects the row and column the key is on. This row+column determines which key is pressed. This way, you don't need a switch per key. Suppose you have 30 keys on a 3×10 matrix. With one switch per key (full n-key rollover), you need 30 switches. But with a grid approach, you need just 3+10=13.

keyboard key ghosting
Grid approach for keyboard circuit. 〔Anti Ghosting Explained @ http://www.microsoft.com/appliedsciences/AntiGhostingExplained.mspx

The problem with the grid approach is that when several keys on the same column or row are being pressed, it has problem knowing exactly which new key is being pressed. So it may not register a key you pressed, or may send a adjacent key that you didn't press. (this is why it's called ghosting)

This is a simple design flaw of circuit, and can be easily fixed, However, fixing this problem so that all keys can be detected correctly when simultaneously pressed, means more electronic components, more cost. But most people never need to press more than 3 keys at the same time anyway, so keyboard makers don't bother with complete solutions. They just make few extra grids for different cluster of keys and or re-arrange the correspondence between the keys and positions on the grid, so that common key combination do not lie in the same column or row.

The modifier keys, for example, {Alt, Ctrl, Shift}, often need to be used with other keys together. So, keyboard makers have made sure that multiple keys with these have no problem. But uncommon combination, such as pressing both Left and Right Shift plus other keys, is practically never used. So they become the victims.

USB Connector and NKRO

USB interface can theoretically detect any number of simultaneously pressed keys. but in practice, due to lazy implementation, most non-gaming USB keyboards default to “boot protocol” in USB, so can only detect max of 6 simultaneously pressed keys.

PS/2 Connector and NKRO

The IBM PS/2 interface (popular from 1990 to ~2010) can always detect any number of simultaneously pressed keys.

Which Keyboard have Full N-Key Rollover?

Most high-grade keyboard have Full N-Key Rollover. But the only easly way to know is to actually test it.

Non-gaming keyboards from Microsoft, Logitech, Apple, do not have n-key rollover.

Who Needs to Press 6 Keys Simultaneously?

Stenotype, braille, and many computer games, all required full NKRO.

Braille2000, see:

To use any computer braille-entry program, including Braille2000, you will need a keyboard that responds to six-key input. Be alerted that many famous-brand computer systems are supplied with keyboards that are NOT suitable. Be especially careful when shopping for a laptop computer not being able to use its built-in keyboard will be a real hassle.

[from http://www.braille2000.com/brl2000/KeyboardReq.htm ]

Why do computer games require pressing more than 6 keys simultaneously?

In gaming, the need to press more than 5 keys simultaneously is common. Usually, the arrows keys or WASD keys are used to control your character movement, while Shift with left/right arrow makes your avatar move left/right instead of turning left/right. Sometimes 2 arrows such as up/right arrow makes your avatar walk diagonally. Add keys for jumping or crouching, usually needed to be combined with avatar movement keys. Add a key for run mode. Then, there's also things like firing a gun, shield, quickly you have 5 or 6 keys pressed simultaneously.

Basic modern keyboards already have shifted their electronic grid so that multi-key combo with the modifier is no problem. But when the game or game playing gets advanced, like doing some strife shooting while prim jump etc as in Second Life , you need a keyboard that does well. For this reason, as cited by Microsoft and elsewhere, gaming keyboards often take the extra mile to make this correct.

As another example, i recall about 10 year ago, i can play Street Fighter on PC, in a 2 player versus mode. For single player, you need 4 keys for the movement and another 4 or 6 for various levels of kick and punch. For 2 person playing on the same keyboard you really need keyboard that can detect some 20 simultaneous keys correctly. Remember those super combo inputs for executing special attacks. LOL

N-key Rollover and Emacs

Discovered a dead key. In emacs, i have the ▤ Menu key set as Hyper, and i have Hyper+Shift+x as a shortcut to some command. However, Microsoft Natural Ergonomic 4000 simply does not register that combination when right Shift is used, but left Shift works. 〔see Emacs Keys: Super Hyper

Reference

联系我们 contact @ memedata.com