Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!decvax!decwrl!pyramid!pesnta!hplabs!hao!seismo!ut-sally!im4u!oakhill!cyb-eng!bc From: bc@cyb-eng.UUCP Newsgroups: net.micro.pc Subject: Re: READING PC/XT KEYPAD Message-ID: <876@cyb-eng.UUCP> Date: Tue, 3-Jun-86 11:03:07 EDT Article-I.D.: cyb-eng.876 Posted: Tue Jun 3 11:03:07 1986 Date-Received: Fri, 6-Jun-86 19:41:16 EDT References: <728@tekcbi.UUCP> <868@cyb-eng.UUCP> <5059@ut-sally.UUCP> Distribution: na Organization: Cyb Systems, Austin, TX Lines: 31 > In article <868@cyb-eng.UUCP>, bc@cyb-eng.UUCP (Bill Crews) writes: > > DOS calls stick to ASCII or "extended ASCII". To get to all keys, you must > > use BIOS and deal with the scan codes. > > Not so. Read in a keyboard character using, say, "c = fgetc(stdin)" or > whatever, then test for "c == NULL". If it IS NULL, then bring in the > character following, which tells you which "extended code" keystroke > was done. The IBM manual tells you the mapping between these "NULL- > escaped" codes and the ASCII character set, but their chart is thoroughly > confusing and I couldn't figure it out; I wrote a small program > to print out this "second code" when a keypad or function key was > pressed. Works like a champ. And, look ma! No bios calls! > -- > Ed Nather You cannot get *all* keys with these codes, Ed. For instance, the original article asked about how to get at the 5 key when all modes are off, and there is no such code for that key. What you have just described is IBM's definition of "extended ASCII", which is what I was referring to. These codes are documented in the BASIC manual (page D-7 in the 3.0 BASIC manual) and maybe somewhere else. The only confusing part to me relates to new or Brand X keyboards and how keys such as keypad keys that have been separated from cursor keys return values. But then I have the same confusion with respect to scan codes (BIOS) for these keyboards. Maybe if I were to buy a new Tech Ref . . . (or such a keyboard). -- - bc - ..!{seismo,topaz,gatech,nbires,ihnp4}!ut-sally!cyb-eng!bc (512) 835-2266