Subject: Re: changing qwerty to dvorak on NetBSD...
To: Nikolas Varrone <nik@temple.edu>
From: Bill Studenmund <wrstuden@netbsd.org>
List: port-macppc
Date: 10/01/2001 12:54:46
Please use a mailer which automatically wraps your lines on transmission.
:-)

On Mon, 1 Oct 2001, Nikolas Varrone wrote:

> 	This may seem an odd and unnecessary question but here goes. I
> am accostomed to typing with a dvorak keyset through the macOS on my
> ibook (recently updated to running NetBSD 1.5.1) the default for
> NetBSD is the QWERTY keyset but I don't know how to change that. I was
> looking through man pages that contained some info about the keyboard
> and while reading the man page for wskbd I found that there was the
> file /usr/include/dev/wscons/wsksymdef.h that defined all of the
> keystrokes. I think that if I simply change this file then I could use
> the dvorak keyset that I am used to. Is this notion correct?

> For example instead of the line
>
> #define KS_S		0x53
>
> it would be
>
> #define KS_O		0x53

I don't think so. If you look at man ascii, you will see that 0x53 is the
ascii representation for 'S'. So what these defines are doing is making
defines which will be used to symbolically represent keys. What you want
to change is the table that maps key codes to ascii - a table which maps
key codes to these defines.

sys/arch/macppc/dev/akbdmap.h has one such mapping for adb keyboards, and
even includes a french keyboard.

sys/dev/usb/ukbdmap.c has a number of such tables for usb keyboards, which
is what I think the ibook uses. There are maps for US, UK, Japanese,
German, French, Danish, Italian, Sweedish, and Norwegan.

> and so on for the complete substitution of keys...  I notice at the
> bottom of the file there is a section that looks like the following
> ...
>
> #define KB_VARTAB \
>
> among many other keysets one line reads...
>
> 	{ KB_DVORAK,	"dvorak" }, \
>
> 	Does anyone know what this means? Is there perhaps a much
> simpler method that I am overlooking?

That means that if you have a struct wscons_keydesc, you can say it is a
KB_DVORAK, and the different utility programs can (in principle) turn the
number from the define KB_DVORAK into the text "dvorak".

Please look at sys/dev/usb/ukbdmap.c. It is the file you want to change.
Make a new keyboard map, based on KB_US, and encode all of the keys which
are in different positions. i.e. I don't think <enter> or the shift keys
moved, so you don't need defines for them. When you're done, please submit
a PR with the change, so it can become a part of the next version of
NetBSD. :-)

Take care,

Bill