Jump to content
  • Advertisement
Sign in to follow this  
Halsafar

Focus lost, dinput fills key buffer

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am not sure why this just started happening now, maybe I left something out btu I just turned my input system into a much more oop like standard. Now anytime I switch away from my game window, almost every button I check for input fires when it definetly shouldn't. Why??? How can I prevent this??

Share this post


Link to post
Share on other sites
Advertisement
Well actually a simple solution has been found already.
I had turned on DInput debug mode for the very first time. I switched back to retail mode and all was fine.

Not only did debug mode gave no error messages it sure created some bugs.

Anyone care to explain this?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Debug mode will generally try to fill buffers that you shouldn't be reading from with garbage so that if you do, you'll catch that bug. On release mode this isn't done for performance reasons, of course. Maybe you were reading from the input buffer at the wrong time, but on Release mode, you were lucky enough to not experience any bad effects.

Share this post


Link to post
Share on other sites
are you checking if FAILED() on IDirectInputDevice8::GetDeviceState? If it fails, then you need to call IDirectInputDevice8::Acquire(). I don't know if this is the case for both exclusive and non exclusive cooperate levels, but I know it is for one.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!