Function NextKey() Foundation
Reads the next key value from the keyboard buffer without removing it.
NextKey() --> nInkeyCode
The return value of NextKey() is an integer in the range of -47 to 422. This value identifies the key which will be taken from the keyboard buffer next. When the keyboard buffer contains no value (no key was pressed), NextKey() returns the value zero.
The function NextKey() is a compatibility function which only reads the keyboard buffer and is limited in scope. In Xbase++, the function NextAppEvent() should be used instead of NextKey() since it processes mouse events as well as keyboard events.
The function NextKey() resembles the function Inkey() and reads the next value from the keyboard buffer. It differs from Inkey(), however, because the value is not deleted but remains in the keyboard buffer. This allows testing for whether or not a key has been pressed. The processing of the key can occur at another place in the program and the key value can be removed at a later time using Inkey().
The function NextKey() provides the same values for a key press as Inkey() and LastKey(). In the header file "Inkey.ch" symbolic constants are defined for all key values.
A DO WHILE loop such as this, where the keyboard buffer is read continuously, requires extensive system resources and unnecessarily delays other applications which could be running during the time when no key is being pressed.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.