Keyboard Behavior – Expected Actions When Holding Down Two Keys

gamingkeyboardkeyboard shortcuts

Context

A friend and I are playing a game where the optimization to playing a given character in the game is to hold down two buttons at once, i.e. they keys Q and E. This would mean that within the game the two skills bound to these keys would go off alternatively.

I.e. when holding Q and E: Q E Q E Q E Q E Q E

Problem

The issue arises in that I am unable to replicate what my friend has done when I hold down the keys Q and E. What I get instead is:

ie. when holding Q and E: Q E E E E E E E E E or E Q Q Q Q Q Q Q Q (depending one which key is detected first)

After discussing with my friend, he says its n-key rollover in addition to anti-ghosting that allows this to work.

However, once both of us began to look deeper into this, it just made less and less sense since both of our keyboards has the aforementioned features. Both of our keyboards are listed below if it provides additional context.

What I'm trying to figure out now is what allows his keyboard to operate the way it does, while mine cannot do the same.

Best Answer

Anti-ghosting only comes into play when at least three keys are pressed — it's irrelevant for only two, so it doesn't matter here.

And for USB keyboards, key repeat behavior is dependent on software, not the keyboard. The keyboard simply tells the computer all of the keys that are held down at the moment (up to the "rollover" limit supported by the keyboard), and lets the computer know whenever that state changes. It's the OS that's responsible for comparing the list of held keys to the previous state and generating the appropriate "key pressed" and "key released" events, and it's the OS that's responsible for noticing when a key has been held down for a certain amount of time and generating extra events, if appropriate.

Every system I've ever seen behaves the way you describe your system behaving — typematic only generates repeats for the last key that was pressed, and only as long as it's held down (if you release that key, but still hold down other keys that were pressed earlier, there are no repeats at all). But since the behavior is defined by software, it should be possible to override it in software, as long as the keyboard is at least 2KRO (which basically all keyboards are; 1KRO would make proficient touch typing basically impossible).

Related Question