home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 26
/
CD_ASCQ_26_1295.iso
/
vrac
/
volume_3.zip
/
KKKK.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1995-11-02
|
1KB
|
68 lines
#include "c:\tc\keyboard.h"
int Write(char *);
unsigned char Write_Edit(char i[]);
void main(void)
{
unsigned char chr,asci;
clrscr();
while(Write(&asci))
{
;
}
return;
}
int Write(char *asci)
{
unsigned char chr;
if( (chr) AND ( (int)chr != 27) )
{
*asci = chr;
cout << chr;
}
else if ( (int)chr == 27)//ESC quits
{
return FALSE;
}
else *asci = NULL;
return TRUE;
}
unsigned char Write_Edit(char i[])
{
// if there is a normal ascii key waiting then return it, else return 0
if (_bios_keybrd(_KEYBRD_READY))
{
unsigned char temp = (_bios_keybrd(_KEYBRD_READ));
if( (int)temp == 8)//Backspace
{
gotoxy(wherex() - 1,wherey());
cout << " ";
gotoxy(wherex() - 1,wherey());
temp = NULL;
return temp;
}
if( (int)temp == 27)
{
return temp;
}
if( (int)temp == 13)//Enter
{
cout << "\n";
temp = NULL;
return temp;
}
if( ( (int)temp >= 32) AND ( (int)temp <= 126) ) //ASCII Character
{
return temp;
}
return(0);
}
else return(0);
} // end Write_File