Need DXInput?

Started by
2 comments, last by g_WinMain 17 years, 8 months ago
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?
Advertisement
you can use DirectInput but nearly everybody say not to use it. Window Messages should be the better way to go (even the DirectX SDK Documentation tells that ^^)
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.
Sirob Yes.» - status: Work-O-Rama.
Just like seeing the sun shine in darkness!
Think you very much

This topic is closed to new replies.

Advertisement