Focus lost, dinput fills key buffer

Started by
3 comments, last by Halsafar 18 years, 11 months ago
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??
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?
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.
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.
Yes I am of course checking that.

This topic is closed to new replies.

Advertisement