HELP!

Started by
2 comments, last by drago 24 years, 5 months ago
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.
Advertisement

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

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

osu!
Is there a tutorial or some source code i can look at on how to implement a buffered approach?

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

osu!

This topic is closed to new replies.

Advertisement