home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_02_04
/
2n04019a
< prev
next >
Wrap
Text File
|
1991-02-10
|
496b
|
24 lines
/*
* KEYS.C Copyright (C) 1990 by Mark R. Nelson
*
* This routine is used to read a character or extended character
* in from the keyboard. It returns immediately if no character is
* available, returning a -1 to indicate no key. A few of the
* extended key codes are defined in KEYS.H
*/
#include <conio.h>
int getkey()
{
int c;
if ( !kbhit())
return( -1 );
c = getch();
if ( c != 0 )
return( c );
else
return( getch() << 8 );
}