home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD2.mdf
/
c
/
library
/
mslang
/
cp1
/
getkey.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-06-01
|
3KB
|
68 lines
===========================================================================
BBS: The Abacus * HST/DS * Potterville, MI
Date: 05-30-93 (07:46) Number: 60
From: LEO VILDOSOLA Refer#: 160
To: JOHN KASIEWICZ Recvd: NO
Subj: EXTENDED KEYS - AFTER THE Conf: (36) C Language
---------------------------------------------------------------------------
JK> In a program of mine, I would like to use extended characters (More
JK>specifically, the Fkeys) .. I am able to decipher the 0, by way of CASE 0:,
JK>I'm not able to read which extended character it is. Could someone
JK>please explain to me the next step to getting, say, a 59 for F1?
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* Source File: GETKEY.C Date: May 29, 1993 */
/* Released As Public Domain */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* Header File(s) */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#include <dos.h>
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* This Function Gets The Next Character From The Keyboard */
/* */
/* Returns The Key Pressed. */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
unsigned short int GetKey( void )
{
union REGS reg;
unsigned short int ch;
while( 1 ) {
reg.h.ah = 0x01;
int86( 0x16, ®, ® );
if( reg.x.flags & 0x40 ) {
int86( 0x28, ®, ® ); /* to allow TSRs to popup */
continue;
}
reg.h.ah = 0x00;
int86( 0x16, ®, ® );
if( reg.h.al == 0x00 )
ch = reg.h.ah | 0x100;
else
ch = reg.h.al;
break;
}
return( ch );
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* End Of File: GETKEY.C */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
This way all you have to do is define your function keys, for example,
by adding 256 to its value (ie, if F1 is 59, you define it as 315).
Vuola, no more conflicts.
G'd day!
Leo Vildosola
* OLX 2.1 TD * ... Real men use BASIC. C is for Unix!!!
--- FidoPCB v1.4 beta
* Origin: XON/XOFF Information Service - Montreal - @xonxoff.com (1:167/15
SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1
SEEN-BY: 153/752 154/40 77 157/110 159/100 125 575 950 203/23 209/209
SEEN-BY: 261/1023 280/1 390/1 396/1 5 15 2270/1 2440/5 3603/20