Archived

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

Input too fast

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