An ioctl question

Barry Margolin barmar at kulla
Sat Oct 28 12:59:40 AEST 1989


In article <2582 at virgin.UUCP> bann at virgin.UUCP (Roger Bannister) writes:
>	I modified this progam that I found in a book so that prints out
>   the hex code of each key.  I noticed that the keypad was producing the
>   same scan codes as the regular keys.  Is there a way to get the keypad
>   to give different scan code like curses.

It depends on the type of terminal you're using.  Some terminals support an
"alternate keypad" mode, which causes keys on the keypad to send escape
sequences instead of the normal characters.  There's generally control
sequences that can be sent to the terminal to turn this mode on and off; it
may also be settable with the terminal's SET-UP mechanism, if it has one.

In the termcap file, the sequences that turn keypad mode on and off are
notated with "ks=" and "ke=", respectively.
Barry Margolin, Thinking Machines Corp.

barmar at think.com
{uunet,harvard}!think!barmar



More information about the Comp.unix.questions mailing list