Sign in to follow this  

Need DXInput?

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

Some books about DX said that a game need DXInput to receive the keyboard and mouse messages,but someone told me to use Windows messages such as WM_KEYDOWN WM_LBUTTONDOWN a game need DXInput or not?

Share this post


Link to post
Share on other sites
Microsoft documents recommend that you do not use DirectInput for keyboard and mouse input. They still recommend using it for joystick input, though (you don't really have many other choices [smile]).

I've found that DirectInput does actually work well when you need to use relative movement of the mouse. For example, if I were to write an FPS, I'd likely use DInput for the mouse input.
I also like how DInput allows you to easily check if a key is currently down. This is also useful for FPS games (say, to check if the user is currently pressing the forward key).

All in all, IMO the best solution would be using messages for anything that requires a cursor, or for when the user needs to type text into a textbox, and Direct Input for any "real-time" input.

Hope this helps.

Share this post


Link to post
Share on other sites

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