home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_200
/
240_01
/
keyin.c
< prev
next >
Wrap
Text File
|
1987-07-30
|
768b
|
37 lines
#include "ciao.h"
/*=============================*/
/* keyin() */
/* */
/* extended ASCII chars are */
/* returned with high bits set */
/*=============================*/
int keyin( wait )
void (* wait)();
{
static int ch;
do
{
(* wait)(); /* while waiting for input */
}
while ( !kbhit() );
ch = getch();
if ( kbhit() && (ch == '\0')) /* extended ASCII */
{
ch = getch(); /* read extended char (Fn key, Keypad, etc.) */
ch |= 128; /* set high bit to flag origin of this char */
}
return( ch & 0xFF ); /* kill sign extension, return values 1..255 */
}