Re: get_key Processing

new topic     » goto parent     » topic index » view thread      » older message » newer message

Hi

Yes, the way I look at is is that wait_key sits and waits for a key, whereas get_key swings by the keyboard buffer, and gets whatever is there, and then carries on.

I have had issues where the keyboard buffer has a had a few key presses in, and then wait_key is called, and takes the first in line, so sometimes it is useful to empty the keyboard buffer before calling wait_key

 
integer c 
 
while get_key() => 0 end while 
c = wait_key() 
 

The integer c in your above code is redundant.

Also if you are using it as a menu input, make your life easier

c = upper(wait_key())

c will always be upper case.

The function keys require special handling, and are platform dependent too. Essentially they put several characters into the keyboard buffer at once.

Check the archive fro some text mode dialogs.

Cheers

Chris

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu