reading more than 2 keys at once from a keyboard?

Started by
12 comments, last by TheAdmiral 17 years, 7 months ago
I was just wondering if it’s possible to read more than 2 at once, I’m working on a full 6d freedom game and it would be much easier to control if they weren’t limited to pressing only 2 keys at once, since I have keys set for: Yaw+ Yaw- Pitch+ Pitch- Roll+ Roll- X+ (Left) X- (Right) Y+ (Up) Y- (Down) Z+ (Forward) Z- (Back) I easily find myself trying to rotate in 2 directions, and move also and my computer doesn't recognize any keys after the first 2 and if you hold down 3 or more, it complains and beeps at you. :)
Quando Omni Flunkus MoritatiWhen All Else Fails, Play Dead!
Advertisement
I believe this is a hardware issue with keyboards. No way around it other than to try different key combinations.
Yep, there's nothing software-related about not being able to press more than 2 or 3 keys at a time. Most keyboards use a system of electrical interconnects which simply can't do more than that at a time. Moreover, each keyboard is different WRT which key combinations it will and won't recognize. Bottom line: modifier keys (ctrl, shift, alt) aside, don't count on users being able to press more than two keys simultaneously.
You could fix the problem by keeping track of up and down key events. Have an array of booleans and when key (x) is pressed down set array[x] = true when key (x) goes up set array[x] = false
Every frame when you update your code you could check the array to see if key (x) is down and take action depending on the function of key (x)
Quote:Original post by SuperNerd
You could fix the problem by keeping track of up and down key events. Have an array of booleans and when key (x) is pressed down set array[x] = true when key (x) goes up set array[x] = false
Every frame when you update your code you could check the array to see if key (x) is down and take action depending on the function of key (x)

No. Again, this is not a software issue. The keyboard literally WILL NOT NOTICE that the extra key was pressed.
Yes I never understood why no one came out with a USB keyboard that used individual key switches instead of the normal electrical matrix way. That way you could get any input sent to the keyboard into the computer. It may be a little less efficient, but with mice sending 2000dpi images to be read every millisecond or whatever I think it should be possible
you could use a
789
4 6
123
setup for 4 dimensions and separate keys for other directions
or you could make it so only a key press (not holding down the key) will make you move in that direction, so repeated presses will accelerate/decelerate.
Or of course let the mouse have a part in movement.
Seems like you dont have many other options if the keyboard will only recognize 2 held down at once ><
"Whatever I feel like, Gosh!"
Quote:Original post by neonic
Yes I never understood why no one came out with a USB keyboard that used individual key switches instead of the normal electrical matrix way. That way you could get any input sent to the keyboard into the computer. It may be a little less efficient, but with mice sending 2000dpi images to be read every millisecond or whatever I think it should be possible


It's simply a cost issue. Having 100 pins on your controller chip is expensive. Having 20 pins is cheap (a 10x10 matrix). Having 20 pins and some kind of of polling system is inaccurate.

Also, 2000dpi is reasonably low resolution when you're capturing such a tiny area.
Pshh, they could just use a few multiplexers... It's not inaccurate if you're polling 1000x a second in hardware.
The ZBoard supposedly allows up to 7 simultaneous key presses. Seeing as they claim "up to" 7 I'm not sure it would work, but unlike most keyboards it at least might.

The Razer Tarantula is currently unreleased (I've unreliably heard Sept 7), but claims "The Razer Tarantula's Anti-Ghosting Capability allows for unlimited simultaneous keystrokes without jamming."

Also some older (pre-PS2) keyboards did not face this problem.

A historical note: Way back in those pre-PS2 days PC games commonly allowed multiple players to share a single keyboard. This trend drastically decreased in popularity as access to LANs became more common.

This topic is closed to new replies.

Advertisement