Mail Archives: djgpp/1999/08/11/07:31:27
On Mon, 9 Aug 1999, guthrie wrote:
> I know how to get input using getch() function...in the program i'm writing
> i want to be able to have the user to choose any of the keys to use ..and
> not just letter keys.
First, getch() can also read arrow keys and other non-ASCII keys: it
returns zero, and you then need to call it again, to get the scan code.
An alternative is to use the function getxkey(). This one goes through
the BIOS, and so recognizes more keys. Its disadvantage is that BIOS
doesn't know about national keyboards, so characters that are produced
using the right ALT key need special translation tables. The header
<keys.h> includes symbolic definitions for all the scancodes of non-ASCII
characters for use with getxkey().
- Raw text -