Subject: console keyboard mapping
To: None <port-mac68k@NetBSD.ORG, briggs@puma.bevd.blacksburg.va.us>
From: Markus Hitter <M.Hitter@trier.fh-rpl.de>
List: port-mac68k
Date: 04/16/1996 14:01:57
On Apr 15,  7:10pm, Ken Nakata wrote:
> Subject: Re: improving NetBSD
> > > I'm interested in how you added the support for international
> > > keyboard.  Is it a portable way?  I mean, is it easy to add a new
> > > keyboard layout to it?
> >
> > It's simple. You just have to make the console recognize the Options key
> > and the combination of the Options&Shift key. The rest is to add two
> > columns for these combinations into the keyboard map in keyboard.h.
> > Probably it's the best to make one file for each available keyboard and
> > select the right one with a link.
[...]
> Does your code have an interface, I mean a program interface, not a
> user interface, to install/deinstall a key map on the fly?  I mean,
> without having to rebuild a kernel, or even having to reboot.

No, the keyboard mapping is as hardcoded as before. This is perhaps not the
most elegant solution, but very useful.

> I think
> this is very important because then we won't have to make a "special"
> kernel for everyone who wants a new key map.  And I don't like the
> idea of keeping every possible key maps around in the kernel, many of
> which I'll never use.

I whouldn't like this, too. The console should be as small and fast as
possible, comfort is a thing of userland programs.

> So, I think it's better to supply such an
> interface (probably an ioctl() for /dev/adb) and key map definition
> files for various international keyboard layouts.  And a user can
> install any of those as he/she wishes, or write one if there isn't any
> already written for his/her keyboard layout.

But how to pass this lot information? We need 5*128 = 640 bytes to pass.
Passing one information per call whould be time consuming and require a
configuration program or script. Passing a pointer to a buffer whould require a
configuration program, passing something like a file descriptor whould require
the the console to read the file, this is new funtionality...

Have I forgotten an option? My experience in device programming isn't too big.
I think one mapping per call whould be best.

> This can be done in /etc/rc.local and you can forget about it once
> the system is up.  Only drawback I can think of with this scheme is
> that one has to put up with the default key map until a preferred map
> is manually installed when booted in the single-user mode.  But I
> don't think it is too high a cost to pay for the benefit I described
> above, is it?

As far I can see the only cost is the additional code for reading the mapping.
There is no need for more data structures or slowing down the code in normal
use.

But at the moment I work on this scrolling problem on the LCII, so this stuff
is left for a later time.

Markus


-- 
-----------------------------------------------------------------------
 Markus Hitter                 email: hitterm@trier.fh-rpl.de
                               WWW: http://www.trier.fh-rpl.de/~hitterm
 Trier (Germany)               Voice: ++49/0651/828172
-----------------------------------------------------------------------