home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Extra Super CD 1998 January
/
PCPLUS131.iso
/
DJGPP
/
V2
/
DJLSR201.ZIP
/
src
/
libc
/
pc_hw
/
kb
/
getxkey.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1995-02-26
|
314 b
|
18 lines
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#include <pc.h>
#include <dpmi.h>
int
getxkey(void)
{
__dpmi_regs r;
r.h.ah = 0x10;
__dpmi_int(0x16, &r);
if (r.h.al == 0x00)
return 0x0100 | r.h.ah;
if (r.h.al == 0xe0)
return 0x0200 | r.h.ah;
return r.h.al;
}