Jump to content
  • Advertisement
Sign in to follow this  
LevyDee

DirectInput

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

Im doing a little research and am thinking about undertaking a personal project of creating a game engine. So i did a little bit of research on DirectInput to handle that sort of thing, and on msdn, it says DirectInput is not suggested for keyboard and mouse and instead should use the normal window Proc to handle events. Why does it say this, and in your guy's opinion, is this true? Thanks

Share this post


Link to post
Share on other sites
Advertisement
Because DirectInput is way harder to use than to simply intersect key press/release messages. On top of that, it creates a thread for that purpose.

So yes, their suggestion (which you should follow most, if not all, of the time) is the right one. Simply drop DirectInput and let it rot in a corner... ;)

Share this post


Link to post
Share on other sites
For keyboard input you definitely shouldn't use it. For mouse input it's OK, provided that you know, understand and accept that it's behaviour is what you want. If that's the case then it's still a solid enough and respectable enough API that will handle a lot of things (such as hiding the mouse cursor, disabling acceleration, clipping to the window rect, etc) automatically for you. So if that's desirable behaviour and if you don't want to have to write your own code to handle it, then by all means it's perfectly fine.

Note that you can easily use DI for mouse input but still use Windows messaging for keyboard input. It's not a case of all or nothing.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!