Advertisement

DInput keypress problem

Started by November 14, 1999 10:19 PM
1 comment, last by BouncePup 25 years, 3 months ago
You may just have to save the device state and check each time to see if the new state of the key is the same as the old one.
ok, here is my really simple code of checking for keypresses:

bool SKeyboard::CheckPress(unsigned char c)
{
char buffer[256];

g_Keyboard7->GetDeviceState(sizeof(buffer), (LPVOID)&buffer);

if(KEYDOWN(buffer,c))
{
return true;
}
else
{
return false;
}

**Now, this works great! It gets the input when a key is pressed, but how can i tell when one is being held down?

Thanks!
Nathan Strandberg


"Always forgive your enemies, nothing annoys them more.."
Advertisement
Thanks! I got it to work now

later -
Nathan

"Always forgive your enemies, nothing annoys them more.."

This topic is closed to new replies.

Advertisement