I'm rather annoyed right now. For whatever reason, I didn't think that determining if the user has 3 keys pressed at once would be so difficult. Attempt to press all the arrow keys that correspond to the arrows being displayed...
Sometimes it works, sometimes it doesn't and I can't understand why or find a pattern to the malfunction. But basically whats happening is at some point the KEY_DOWN event just isn't dispatched for a particular arrow key once two of the other arrow keys have been pressed. Does anyone have any freaking idea why this is happening?



5 Responses to “More Than Two Simultaneous Key Presses and KeyboardEvent.KEY_DOWN Woes”
By Ash on May 12, 2008 | Reply
Definitely noticed this before with flash games.
Up Down Left doesn’t work, nor does Up Left Right.
By Tony Fendall on May 12, 2008 | Reply
The problem comes from the way in which the signal for the pressed keys moves from your keyboard to your computer. The signal is only 8-bit, and there are limits to how the signal can be changed to represent more than one key being pressed in combination.
Long story short, the guys who designed the origional keyboards made a descision to support all two key combinations, and then selected as many three key combinations as they could support with the hardware. This meant that some combinations had to be left out, and they had to make a descision about which ones were more important.
It just happens to be that they chose not to support three key combinations which involve the up arrow key. I do not think there is any solution to this problem…
By Josh Dobbs on Jun 9, 2008 | Reply
I tried this on my laptop over the weekend and was only able to get all three keys at once a couple of times. I just tried it on my desktop though and I was able to get all three keys almost every time. Im wondering if it has to do with the keyboard itself or the keyboard driver. Im using a dell keyboard that’s about 5 years old.
By Clint on Jun 9, 2008 | Reply
There is also a difference betweeen keyboard models.
I discovered this when developing a racing game where we used a combination of space bar, left key and up all had to be pressed to accelerate, turn and jump all at once.
Microsoft keyboards worked fine, Dell keyboards did not.
You cannot achieve acceleration, and jump during a turn on the Dells, putting some players at a disadvantage.
By Clint on Jun 9, 2008 | Reply
By the way. On my microsoft keyboard, all combinations work fine. Go figure.