🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

DInput keypress problem

Started by
1 comment, last by BouncePup 24 years, 7 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.
Advertisement
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.."
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