First commit 11/11/1991
This commit is contained in:
32
KEY.CPP
Normal file
32
KEY.CPP
Normal file
@ -0,0 +1,32 @@
|
||||
#include <alloc.h>
|
||||
#include <conio.h>
|
||||
#include <dos.h>
|
||||
#include <mem.h>
|
||||
|
||||
void *Pantalla;
|
||||
int x,y;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
int key = 0, key1 = 1;
|
||||
|
||||
if ( ( Pantalla = malloc( 4096 ) ) == NULL ) return;
|
||||
// Guardamos el contenido de la pantalla
|
||||
memcpy( Pantalla, MK_FP(0xB800,0), 4096 );
|
||||
x = wherex(); y = wherey();
|
||||
|
||||
clrscr();
|
||||
|
||||
cprintf( "Para Salir pulse ESC ( sc.27 )\n\r" );
|
||||
cprintf( "------------------------------\n\r" );
|
||||
while( key != 27 )
|
||||
{
|
||||
if ( ( key = getch() ) ==0 ) key1 = getch(); else key1 = 0;
|
||||
cprintf( " % 3d % 3d \n\r", key, key1 );
|
||||
}
|
||||
|
||||
// Restauramos el contenido
|
||||
memcpy( MK_FP(0xB800,0), Pantalla, 4096 );
|
||||
gotoxy( x, y );
|
||||
free( Pantalla );
|
||||
}
|
Reference in New Issue
Block a user