• Advertisement
Sign in to follow this  

DirectInput

This topic is 4706 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

Using the DirectInput when the application is switched to background the input is lost, and when the application returns I get the InputLost error. What I did is declaring a flag telling me whether the application is in background and not. (updating it when getting the WM_ACTIVE message) and when retreiving input, before calling the getstate/data method I check this flag. If true (app is in background) I return from the method without checking for input. If false I call the appropriate DirectInput method and if I get the InputLost error I acquire the device and try again. Is that the right way to handle this situation ?

Share this post


Link to post
Share on other sites
Advertisement
Yup. That's exactly what I do too. You can also do things like insert a Sleep() call in your main loop if that flag is set, so you don't eat up all the CPU when your app isn't in the foreground.

Share this post


Link to post
Share on other sites
I've another question...
If I use my DInput device in an app... Should I include some .dll in Release version of build?!

THANKS ^__^

Share this post


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

  • Advertisement