Sign in to follow this  
Tendonin

Input

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 this post


Link to post
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 this post


Link to post
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[i] = keystate[i];
keystate[i] = (GetKeyState(i) < -100);
}
}



Share this post


Link to post
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 this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this