Curses and the arrow keys

Jerry Frain jxf at procyon.cis.ksu.edu
Mon Aug 27 22:55:21 AEST 1990


In article <773 at studsys.mu.edu>, jetzer at studsys.mu.edu (Mike Jetzer) writes:
> In article <1990Aug24.175453.4310 at irscscm.UUCP> mlake at irscscm.UUCP
(Marshall Lake) writes:
>>I am writing a program which will be taking advantage of curses.
> [ . . . ]
>>I am doing a getch () and if I get an ESCAPE I do
>>another getch ().  If I addch () for each character I get (the ESCAPE
>>and the next character) then the cursor moves around properly on the
>>screen but the x/y coordinates in the window structure do not follow
>>suit.  Curses is recognizing the arrow keys simply as regular
>>characters.  Am I naive in thinking that curses is smart enough to
>>handle the arrow keys specially?  Should I be moving the cursor
>>manually via the move function?
> 
> Your naivete could be corrected by reading the manpage on curses.

Unless Marshall is using BSD curses.  I, also, am writing an application
which requires the use of arrow keys, but I am using BSD curses.  There
is nothing in the man page about using the arrow keys, because there is
no keypad() function, and hence no standardized way of using the arrow
keys with BSD curses.

I be able to answer Marshall's questions (relative to Berkeley curses) in
the next week or so, as soon as I do a little more research into this
dilemma.  If anyone is interested, I will post what I find.

--
Jerry Frain -- Perpetual Student		Kansas State University
                                 	Department of Computing & Info Sciences
Internet : jxf at ksuvax1.cis.ksu.edu                Manhattan, Kansas
UUCP     : ...!{rutgers,textbell}!ksuvax1!jxf



More information about the Comp.unix.questions mailing list