Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FUNCky - <b>name:</b> <b>waitkey() - get a keystroke like inkey()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Name:     waitkey() - get a keystroke like inkey()
  Usage:    <key> = waitkey([<ticks>])
  Params:   integer <ticks> - clock ticks to wait for the keystroke.
            <ticks> is optional. Similar to inkey(), Waitkey() will
            wait for a keystroke but unlike inkey(), waitkey() is
            a wait state so SET KEY TO routines work while waiting.
            The <ticks> value is in clock ticks where 18 is approx.
            one (1) second. Specifying no <tick> amount instructs
            waitkey() to check for a keystroke, returning it if there
            is one. If no keystroke is waiting in Clipper's buffer
            a zero is returned. Specifying a <tick> count of
            zero (0) will instruct waitkey() to wait until a key
            is pressed. waitkey() works with the timeout() and onkey()
            function as well.

  Returns:  integer <key> - keystroke value equal to inkey() values

 ---------------------------------- Example ---------------------------------

                 mkey = waitkey(0)   && wait for keypress

                 set key 28 to HELP
                 do while .not. eof()
                      if waitkey() = 27
                           exit
                      endif
                      skip 1
                 enddo

                      or:

                 print(10,0,"Press any key to continue...)
                 waitkey(0)


See Also: strstuff() nstuff() typeahead()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson