Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / a simple menu error

Author
Message
Daygamer
14
Years of Service
User Offline
Joined: 16th Mar 2010
Location: United States
Posted: 7th Jul 2010 08:07
Hey,

I've got a simple problem that has been bothering me for a while.



In my example code it is very hard to move the cursor to one of the middle options, because you would have to release the key faster than the program loops, right? Like if you want to Load Game you can’t get the cursor to it. Is there any genius command that will fix this? I've tried many stupid things like this:



This the player time to let their finger off the key, but it's not very cool and I hate it.

thanks everyone.

Have a nice day, God Bless You!
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 7th Jul 2010 11:39 Edited at: 7th Jul 2010 11:41
You need a veriable to hold the timer() value of the last keypress.

Then you need to check that value, against the current Timer() value; and not accept another input until 200ms has passed.



Dia
19
Years of Service
User Offline
Joined: 16th Jan 2005
Location:
Posted: 7th Jul 2010 12:46 Edited at: 7th Jul 2010 12:49
either that or use a key lock in your code, something like



of course this means you have to press and release the up key every time you want to change option. It depends if you are after that or a time based one like prof said above

This is not the Sig you are looking for....
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 7th Jul 2010 19:12 Edited at: 7th Jul 2010 19:14
Or stop all action till the user lets go of the key.



A timer would be better looking though.

Daygamer
14
Years of Service
User Offline
Joined: 16th Mar 2010
Location: United States
Posted: 8th Jul 2010 06:14
thanks everyone. I plugged in all those snippets to my program, and they all got the job done. Thanks for the ideas!!!

For anyone reading this, here is all those spinnets pulled into my program:

Timer Option:


"Lock" Variable Option:


All Stop Option:




Have a nice day, God Bless You!

Login to post a reply

Server time is: 2024-11-23 14:01:55
Your offset time is: 2024-11-23 14:01:55