Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!samsung!usc!snorkelwacker!think!kulla!barmar From: barmar@kulla (Barry Margolin) Newsgroups: comp.unix.questions Subject: Re: An ioctl question Message-ID: <31193@news.Think.COM> Date: 28 Oct 89 02:59:40 GMT References: <2582@virgin.UUCP> Sender: news@Think.COM Distribution: na Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 18 In article <2582@virgin.UUCP> bann@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@think.com {uunet,harvard}!think!barmar