Jump to content
  • Advertisement


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


Input too fast

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

I am using direct input, and I have a simple menu that when you press the arrow keys it moves from location in the menu too the next. All works fine except if I press down even gently it moves down like 4 locations immediately. How do I slow it down like it does when I use WM_KEYDOWN? Thanks in advance.

Share this post

Link to post
Share on other sites
Use an unsigned long variable called timeLastKeyPress to hold the time of last key press. So when you get a key movement, check if some amount of time has passed between NOW and timeLastKeyPress. If a certain amount of time has not passed, do not register the key as being 'pressed.' Works perfectly. I use a value of 100 for the time that must have elapsed between key presses (in msec).

I remember this exact problem happened to me and it baffled me for days. It sucked

[edited by - randomDecay on October 17, 2002 2:35:23 AM]

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!