//******************************************************************* // File: corpskey.cpp // Author: Jeff Ruby // Agency: U.S. Army Topographic Engineering Center // Last Modified: 11/1/94 // // This is the source file that is used to get input from // the keyboard. It converts from char to int so the // special keys(F1,F2,INSERT,PAGE DOWN,etc.) can have a // unique value. //******************************************************************* #include #include "corpskey.h" int GetKey(void) { union { int c; unsigned char ch[2]; } key; key.c = get_key(); // Return the char value or value+256 if special char. if(key.ch[0]!=0) return key.ch[0]; else return 256+key.ch[1]; } int get_key(void) { union REGS r; r.h.ah = 0; return int86(0x16, &r, &r); }