This is what I always do
Code:
bool enterPressed, aPressed, (whatever else);
then under WM_KEYDOWN, you put:
Code:
switch(lParam [or whatever holds the key code])
{
case VK_ENTER:
enterPressed = true;
break;
case 'A':
aPressed = true;
break;
//whatever other keys
}
and under WM_KEYUP you set the bools to false. Then in KeyDown() you check if the bools are true. Then KeyDown() would know the key has been pressed down and is still down.
Or you could make another bool, to see if KeyDown() had been called yet. When KeyDown() gets called, set it to true, and set the bool for the key being checked to false, and under WM_KEYDOWN check to make sure that KeyDown() hasn't been called yet before setting the key's bool to true. Under WM_KEYUP, set the key's bool to false, AND make the bool for KeyDown() to false. That would make sure KeyDown() only thinks the key is pressed once when you press the key and hold it.
Is that what you wanted?
*I thought most of that up on the spot, so there MIGHT be bugs.
**Try not to make run-on sentences, because those are hard to understand.. besides, your L.A. teacher will strangle you if he/she sees them.