Xref: utzoo comp.os.msdos.programmer:5645 comp.sys.ibm.pc:55383 Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!spool.mu.edu!sdd.hp.com!wuarchive!psuvax1!psuvm!kqs From: KQS@psuvm.psu.edu (Kevin Sullivan) Newsgroups: comp.os.msdos.programmer,comp.sys.ibm.pc Subject: Re: Reading extended keys Message-ID: <91165.183156KQS@psuvm.psu.edu> Date: 14 Jun 91 22:31:56 GMT References: Organization: Penn State University Lines: 23 I took this out of the C language groups, since it is not appropriate there... The code returned when a key is pressed has to be in the range 0-255. However, there are more than 255 different key-combinations. To get around this, IBM uses a special code to flag special keys. Whenever a special key (F1, for example) is pressed, two numbers are put into the keyboard buffer. The first is a 0, the second is a number representing the key that was pressed. Therefore, if getchar() returns a '\0', you know that: 1) A special key has been pressed and 2) You must call getchar() again to find out which special key was pressed. I don't have a list of what the various key codes are with me, but it is trivial to write a program to show the codes and write them down. Kevin Sullivan BITNET: KQS@PSUVM Student Consultant - CAC INTERNET: kqs@vm.psu.edu Penn State University Old programmers don't die...they I don't speak for Penn State... just branch to a new address. Penn State doesn't speak for me.