Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

johnnyBravo

Difference between directinput: keyboard against the message handler way

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

Hi, whats the difference between using directinputs keyboard instead of checking for key inputs in the message handler way? i think its called wm_char or wm_key or something like that thanks

Share this post


Link to post
Share on other sites
Advertisement
if you hold the down a key, the WM_CHAR message will be sent only a few times a second. With Direct Input you can check to see if a key is pressed whenever you want. Basically its more control and you really need it in games.

Notice how if you''re in a text box and you push and hold say ''j'' a ''j'' will instantly appear and then about a second later it will start spitting out a bunch of ''j''s. This is an example of how slow the message system is. Its good for applications but bad for games

Share this post


Link to post
Share on other sites
Its not that its slow, its that repeat rate is taken into account and prevents them from being sent.

By polling the keyboard with DirectInput, you can know exactly what keys are being pushed on that frame and that quick response is required in games.

WM_CHAR for typing, DirectInput for everything else.

[edited by - GroZZleR on June 8, 2004 11:40:48 PM]

Share this post


Link to post
Share on other sites

  • 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!