snextkey - insert a key into the input key queue


int snextkey (ch)
int ch;


Snextkey inserts the character specified by ch into form(C-3)'s
input key queue. The character ch may be an ASCII character, a
getkey(C-3) key value symbolically defined in the include file
\cbase\include\cbase\escape.h or a form function key value
symbolically defined in \cbase\include\cbase\form.h.

The input queue holds a maximum of 32 characters. Form takes
input from the input queue first, then from the keyboard.

Whenever form displays an error message, form clears the input
queue. Any pending operations inserted into the input queue by
snextkey are removed.

For example, the following user edit routine makes the F9
function key in UPDATE mode automatically do a STORE, FIND, and
UPDATE. Note that if form cannot do one of the operations, the
remaining ones are discarded.


char *
user_edit (type, edit_name, old_value, new_value, exit_char)
int type;
char *edit_name;
char *old_value;
char *new_value;
int exit_char;

if (type == U_FKEY && exit_char == F9
&& smode() == F_UPDATE) {
snextkey (F_STORE);
snextkey (F_FIND);
snextkey (F_UPDATE);


form(C-3), getkey(C-3)
Chapter 3, Form Programming Guide
Chapter 2, Terminal Independent I/O


If there is no room in the input queue, snextkey returns 0. If
the character is successfully inserted into the input queue,
snextkey returns a non-zero value.


Snextkey is only available in user edit routines.