home *** CD-ROM | disk | FTP | other *** search
- // keyboard.cpp Keyboard class non-inline mehtods.
- //
- // (c) Aspen Scientific 1989. All Rights Reserved.
- // Author: Vaughn Vernon
-
- #include "keyboard.cls"
-
- #include <dos.h>
- #include <conio.h>
-
- static union REGS kRegs;
-
- int
- Keyboard::input(int wait)
- {
- if (!wait && !kbhit())
- return (keyI = -1);
-
- kRegs.h.ah = 0;
- int86(0x16, &kRegs, &kRegs);
-
- if (kRegs.h.al != 0)
- keyI = kRegs.h.al; // regular key
- else
- keyI = kRegs.h.ah | extMask; // extended key
-
- return keyI;
- }
-
-