Sign in to follow this  

DirectInput

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

This topic is 2634 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this