home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / pc_hw / kb / getkey.c next >
Encoding:
C/C++ Source or Header  |  1995-02-26  |  279 b   |  16 lines

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. #include <pc.h>
  3. #include <dpmi.h>
  4.  
  5. int
  6. getkey(void)
  7. {
  8.   __dpmi_regs r;
  9.   r.h.ah = 0x10;
  10.   __dpmi_int(0x16, &r);
  11.  
  12.   if (r.h.al == 0x00 || r.h.al == 0xe0)
  13.     return 0x0100 | r.h.ah;
  14.   return r.h.al;
  15. }
  16.