• Advertisement

Archived

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

HELP!

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

Guest Anonymous Poster
200ms? Dude, it's good for realtime, but not for a menu. I would suggest to implement a buffered approach, so this way you'll know for sure when the user pressed a key.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster

I think the idea of _kill_ is the best to do.
But anyway the one that I think what is wrong in the code is the function CheckKeys

Try to change for:

void CheckKeys()
{
if(KEY_DOWN(VK_DOWN)&&!bVK_DOWN)
{
dwOldTime = timeGetTime(); // Get old time
bVK_DOWN = true;
BlitShit();
}
}

Sorry my english

Share this post


Link to post
Share on other sites
Im stuck, maybe somebody can help me...
I've run into a problem with my menu, with the keyboard input, what it should do:
after every 200ms process a pressed key,

this is what i've got..
...
while(1)
{
CheckKeys()
if((timeGetTime()-dwOldTime)>200)
{
dwOldTime = timeGetTime();
bVK_DOWN = false;
}
}
void CheckKeys()
{
if(KEY_DOWN(VK_DOWN)&&!bVK_DOWN)
{
bVK_DOWN = true;
BlitShit();
}
}
with this approach the menu (that's what im using it for) is very buggy, sometimes it registers a pressed key and does what it's supposed to, but often it doesnt...

------------------
Drago

Share this post


Link to post
Share on other sites
Is there a tutorial or some source code i can look at on how to implement a buffered approach?

------------------
Drago

Share this post


Link to post
Share on other sites

  • Advertisement