Input

This topic is 4695 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

So I have been looking around for tutorials on getting input from the keyboard. And have had some success. However, I am having problems having the system record more than 4 keys being depressed at the same time. This is a problem for me as I am trying to have 2P on the same keyboard. Does anyone know how this can be overcome. (Doing this for a windows program)

Share on other sites
It sounds like you've run into a problem inherent to keyboards themselves. When you hold down these 4 keys more than does your computer start beeping? Unfortunately, as far as I know there isn't any way around this since it's a problem with the hardware, not the software. If someone has the "keyboards are evil" article link handy it has an explanation on why certain combinations of keys can't be depressed all at once.

Share on other sites

I've got decent results with this code but im sure its subject to the same problem..

bool keystate[256];bool lastkeystate[256];void PollKeys(int low, int high){  for int i = low; i < high; i++  {    lastkeystate = keystate;    keystate = (GetKeyState(i) < -100);  }}

Share on other sites
I have had a decent amount of success getting keys to respond, but does anyone know how to have more than 6 keys pressed down at any one time? I have tried nearly every combination I can think of.

Does anyone know a way to have enable more than six keys? I checked against the matrix shown in the keyboards are evil article and I managed re create the problems of circuit overlapping. But this new problem confuses me.

Share on other sites
I believe it may be a hardware limitation of the keyboard.

1. 1
2. 2
Rutin
22
3. 3
4. 4
frob
16
5. 5

• 9
• 33
• 13
• 12
• 10
• Forum Statistics

• Total Topics
632577
• Total Posts
3007163

×

Important Information

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!