Syntax
void GtSetKeyRead( ItemBlock block );
Arguments
block is called with 0 before reading buffered input. Return a nonzero key code to supply input, or 0 to read normally. Pass NULL to remove the callback.
Return value
No return value.
Description
The callback can supply a key directly. This example provides a key once and removes the callback immediately after reading it.
Example
#include "xdev-wtui.h"
#include <stdio.h>
static int supplyKey( int value )
{
( void )value;
return 'A';
}
int main( void )
{
GtSetKeyRead( supplyKey );
int key = Inkey( NIL, NIL );
GtSetKeyRead( NULL );
printf( "Key code: %d\n", key );
return 0;
}