Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide To Clipper - <b>nextkey()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
NEXTKEY()


Syntax:     NEXTKEY()

Purpose:    To read the next keystroke without removing it from the
            keyboard buffer.

Returns:    An integer numeric value.

            NEXTKEY() returns a number from -39 to 386, identifying the
            ASCII code of the key pressed (the same value as returned by
            INKEY() and LASTKEY()).  If the keyboard buffer is empty,
            NEXTKEY() returns zero.  If SET TYPEAHEAD is zero, NEXTKEY()
            always returns zero.

            NEXTKEY() returns values for all function, Alt-function,
            Ctrl-function, Alt-letter, and Ctrl-letter key combinations.

Usage:      Since NEXTKEY() does not remove the key from the keyboard
            buffer, you can use it to poll the keyboard and then pass
            control to a routine that uses a wait state to fetch the key
            from the buffer.

Library:    EXTEND.LIB


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

   KEYBOARD CHR(27)
   ? NEXTKEY(), LASTKEY()           && Result: 27 0
   ? INKEY(), LASTKEY()             && Result: 27 27


See Also: INKEY() LASTKEY() ReadKey() Keyboard codes

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