Subject: Re: How to navigate timezone menus on sparc keyboard????
To: None <Robertdkeys@aol.com>
From: Greg A. Woods <woods@weird.com>
List: port-sparc
Date: 10/06/2002 18:38:59
[ On Sunday, October 6, 2002 at 16:18:45 (EDT), Robertdkeys@aol.com wrote: ]
> Subject: Re: How to navigate timezone menus on sparc keyboard????
>
> We are still not quite seeing eye to eye, Greg.
> The problem is in how keys are interpreted by
> sysinstall (or whatever drivers are feeding it).
> In the timezone area of the sysinstall suite,
> on Sun hardware, it can't interpret any of the
> usual cursor movements to move to a timezone and
> select it.  On the installed system the termcap
> uses ctrl-HJKL as default cursor movements as in
> vi, for example, when editing scripts or what.

Well, that's not exactly how it works.  As I'm sure you know the cursor
keys of whatever keyboard you're typing on produce some character or
sequence of characters.

On the Sun keyboard on a Sun workstation, when running a NetBSD kernel,
the cursor keys are, as far as I can see from the keyboard driver
sources, supposed to generate the "standard" ANSI X3.64 escape
sequences, just as they do on a real VT100 terminal (by default), or in
an 'xterm' (by default).

The 'sun-il' (and thus 'sun') termcap entries contain cursor key
capability definitions ('kd', 'kl', 'kr', or 'ku') matching those ANSI
X3.64 escape sequences.  That's true of both the full termcap file as
well as the one included in the INSTALL miniroot.

Nvi (the NetBSD version of 'vi') is a curses based application.  In the
right mode it uses the termcap cursor key definitions to identify escape
sequences sent by cursor keys and it executes the appropriate cursor
movement command.  It also interprets the normal 'h', 'j', 'k', and 'l'
characters as cursor movement commands (in the right mode, of course).

I don't think you will find plain 'h', 'j', 'k', and/or 'l' in any
termcap definitions for the 'kd', 'kl', 'kr', or 'ku' capabilities for
any terminal.  :-)

Sysinstall is also a curses based application and assuming the TERM
environment variable is set to 'sun' or 'sun-il', and assuming the
correct termcap file is installed on the filesystem with sysinstall,
then it should have no trouble interpreting the NetBSD/sparc console's
cursor keys.  It does work right for other terminal types using the
serial console, even for the menu in question, so the termcap file is
likely to be correct and sysinstall is functioning correctly.  That
leaves the driver and the hardware as possible failure points (or just a
few bytes of corruption in the install filesystem you happened to load).

> Sysinstall does not detect any of that correctly
> so one can't move and select timezones using any
> of the usual expected cursor movement codes from
> the keyboard.  The [sun] termcap was selected at
> boot time, so SHOULD handle things correctly?
> It doesn't.  Something needs tweaking....

You should test that the cursor keys work as expected with your keyboard
in other curses based applications once the system is running multiuser.

If they work in multi-user mode with, say, a GENERIC kernel then there's
possibly some kind of keyboard driver problem with the INSTALL kernel --
otherwise it's probably your keyboard at fault, though you can test that
by capturing and translating some cursor keystrokes to printable form by
typing a line of them to 'vis' or 'od -c'.  With 'stty echoctl' in
effect they should also be visibly echoed to the screen too.

Here I type a line with one press of each cusor key, then press return,
and finally the EOF character (<CTRL-D>):

$ stty echoctl
$ od -c
^[[A^[[C^[[B^[[D
0000000  033   [   A 033   [   C 033   [   B 033   [   D  \n            
0000015
$ 

-- 
								Greg A. Woods

+1 416 218-0098;            <g.a.woods@ieee.org>;           <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>