Functions

LastKey

Return INKEY() value of last key extracted from the keyboard

Syntax

Signature
int LastKey( void );

Arguments

No arguments.

Return value

The stored code of the last event returned by Inkey(), or 0 if no code is stored.

Description

Read the stored result of the most recently accepted input, for example to check how an input routine ended. It reads the saved code without taking the next queued event. Use `NextKey()` to inspect pending input.

Example

lastkey.c
#include "xdev-wtui.h"

#include <stdio.h>

int main( void )
{
   DispOut( "Press a key.", NULL );
   Inkey( 0, NIL );
   printf( "Last key: %d\n", LastKey() );

   return 0;
}