Article View: comp.os.msdos.programmer
Article #4075Re: Ascii codes for 'Alt' keychords
From: Steelworker
Date: Sat, 15 Dec 1990 20:35
Date: Sat, 15 Dec 1990 20:35
50 lines
2302 bytes
2302 bytes
In article <1990Dec14.221221.20958@cs.columbia.edu> olasov@cs.columbia.edu (Benjamin Olasov) writes:
} I can't find them anywhere (I know I'm probably looking in the wrong
} places) - does anyone have them in emailable form?
}
} (If you even have the code for 'Alt-F5' it would be great!)
}
} Ben
The way keyboard input works in turbo c is this-
The function getch() returns 0 on a special key hit. ( ie function
keys, pageup, page down, etc) The next call to getch will return the
"scan code" of the key hit. You need to do some experimentation to
figure out what all the codes are, or find some list. I wrote a
program that that prints out the scan code and ascii value of
keys pressed, among other things.
/*****************************************************************/
/* No copyright, whatsoever */
#include <bios.h>
#include <stdio.h>
main()
{
int i=0;
while((char)i != 27) {
i=bioskey(0); /* get a key if is one waiting, else return 0 */
/* High byte of i is the scan code, the low byte is the ascii*/
if(i!=0)
printf("%x %x\n",i,bioskey(2)); /* second call is to get */
/* mod key states */
}
}
/********************************************************************/
If you don't have turbo-c, then use some interrupt function to
call interrupt 16 hex with 0 in _AX for bioskey(0),
16 hex, _AX = 2 for bioskey(2);
Return value for both is in AX, I believe.
( and for those of you with extended keyboards, you can add 0x10 to
the numbers and get extended codes as well!)
Good luck,
Robert Blair
6600m00n@ucsbuxa.ucsb.edu
Technical Details
Message-ID:
<7850@hub.ucsb.edu>Path:
arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!wuarchive!usc!ucsd!hub.ucsb.edu!6600m00nReferences:
<1990Dec14.221221.20958@cs.columbia.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!wuarchive!usc!ucsd!hub.ucsb.edu!6600m00n From: 6600m00n@ucsbuxa.ucsb.edu (Steelworker) Newsgroups: comp.os.msdos.programmer Subject: Re: Ascii codes for 'Alt' keychords Message-ID: <7850@hub.ucsb.edu> Date: 15 Dec 90 20:35:17 GMT References: <1990Dec14.221221.20958@cs.columbia.edu> Sender: news@hub.ucsb.edu Reply-To: 6600m00n@ucsbuxa.ucsb.edu Followup-To: alt.msdos.programmer Distribution: na Organization: University of California -- Santa Barbara Lines: 50 In-reply-to: olasov@cs.columbia.edu's message of 14 Dec 90 22:12:21 GMT