Glynn,
From: Glynn Clements <glynn.clements@virgin.net>
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
To: Wayne Gibson <gibson@coas.oregonstate.edu>
Cc: grasslist@baylor.edu
Subject: Re: [GRASSLIST:5655] arrow keys not workingWayne Gibson wrote:
After compiling on a SUN, the cursor keys are not working in the
window where the user interactively can set LOCATION, MAPSET, and
DATABASE. I believe this is generated from "etc/set_data". By the
way, this is the same program that experienced compiling problems
before due to the curses library and since fixed (at least I thought
so).Look at the HAVE_KEYPAD line in src/include/config.h. If the macro is
undefined, then your curses library doesn't support the use of cursor
keys (at least, configure failed to detect the keypad() function). If
the macro is defined, then either it's a bug in the curses library, or
xterm's termcap/terminfo entry is broken.
The macro is define.
In addition, I tested out the ncurses library with the supplied test program
"ncurses", option "a"( keyboard and mouse input test). The arrow keys are
correctly mapped as:
0405 KEY_RIGHT
0403 KEY_UP
0404 KEY_LEFT
0402 KEY_DOWN
Also, the same test program with option "g"(display windows and scrolling)
correctly allows me to move around the screen with the arrow keys.
I compared the libraries required by "set_data" in the 5.0.0 pre-compiled
version and 5.0.1 that I compiled. The pre-compiled uses both libncurses and
libcurses while the version I compiled uses libncurses only. It that what one
should expect? (5.0.0 "set_data" works)
BTW, Ctrl-K should have the same effect as the up-arrow key, Ctrl-L
the same effect as the right-arrow key, and Return/LineFeed the same
as the down-arrow key; there isn't an exact equivalent to the
left-arrow key.
It would be great to have both left and right arrow keys working. Those are the
2 I use the most.
After I enter <ESC><ENTER> and proceed to working in the GRASS
terminal window, then the cursor keys start working again.Bash doesn't use curses; it has it's own ad-hoc mechanism for handling
extended keys.GRASS uses the standard curses interface, i.e. it calls keypad() to
enable the cursor keys, then processes the extended codes (KEY_LEFT
etc) which the curses library should generate for extended keys.If curses fails to process the keys correctly, then they won't work.
--
Glynn Clements <glynn.clements@virgin.net>
Wayne
-----------------------
Wayne Gibson
Oregon State University
gibson@coas.oregonstate.edu
(541) 737-5696