term_kbget
Previous Topic  Next Topic 

Synopsis:

        key=term_kbget()


Arguments:

       NONE


Description:   This function suspends the calling task until a key has been hit and returns the ASCII value of the key that was pressed.   If there are already one or more keys in the keyboard buffer then this function will return immediately with the ASCII value of the first key in the keyboard buffer and will remove that key from the buffer.             


Only one task can be calling term_kbget() or term_kbgetx() at any one time.     If there is already a task waiting for a key press with this function then any other tasks calling this function will cause the function to display an error message and a blank string ("") will be returned.


It is possible to obtain the number of keys waiting in the keyboard buffer by calling the term_kbqsize() function.


A maximum of 256 keys can be held in the keyboard buffer before they start being overwritten.



Returns:  Returns a string containing the string that was pressed.