Jump to content

  • Log In with Google      Sign In   
  • Create Account

HELP!


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 drago   Members   -  Reputation: 150

Like
Likes
Like

Posted 24 October 1999 - 04:08 PM

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


Sponsor:

#2 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 24 October 1999 - 03:30 PM

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.

#3 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 24 October 1999 - 03:40 PM


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


#4 drago   Members   -  Reputation: 150

Like
Likes
Like

Posted 24 October 1999 - 04:08 PM

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

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





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS