[comp.windows.x] Key Maps...one more time...

dshr@SUN.COM (David Rosenthal) (03/15/88)

I really think you need to read the protocol spec.,  because
reading your mail it looks to me like you don't understand
the model of keyboard support in X11.  X11 clients see raw
unencoded keycodes,  placing any kind of interpretation on
these key transitions is their responsibility.  There is a
table in the server that they can enquire to find out what
is written on the keys,  to assist in interpreting the events.
It is possible for clients to overwrite this table,  but they
are STRONGLY advised never to attempt to do so - this is NOT
the way in which keymapping should be done.  By doing so,
they disrupt the process by which other clients (which may
not have an ASCII-centric view of the world) interpret
the raw keycodes.  Your example of a server unable to determine
the type of the keyboard is almost the only case in which
a client might sensibly overwrite the table.  The other example
is people who use Dvorak keyboard layouts,  but they are
also advised to actually change the symbols written on the
keycaps.

As an implementor of keyboard support for both X10 and X11
I can assure you that the LAST thing you want is an X10-ish
approach to keyboard support - it mandated that every keyboard
in the world had to imitate a DEC LK201 - one of the world's
more bizarre peripherals.

In the grand X11 tradition,  we have given you a totally
policy-free mechanism,  and enough rope to hang yourself
many times over.  As in other cases,  clients will find
that dealing with this generality is triesome.  But the
generality is there for a very good reason.....

	David.

bzs@BU-CS.BU.EDU (Barry Shein) (03/15/88)

Ok, if you can suffer me one more time (I know, I can be tiresome) can
I pose the merits of a facility similar to the X10 approach one more
time...

You have to make a decision for some sort of default key mapping, it's
unavoidable or else keys wouldn't transmit anything to clients.

Currently these are set up at compile time on a per server, device
dependant basis.

I claim that this should be possible at server startup time through a
file, optionally (retain the current scheme but allow a user
override.)

One "generic" reason is that regardless of later per-client over-rides,
a server might accept more than one keyboard type and may not be able
to distinguish it at start-up (hardware may not tell the O/S.)

For example, all those potential '386 clones out there ready to run
X11. Those sort of folks buy 3rd party keyboards from the likes of
Keytronics and whatever default is distributed will have to accomodate
them in various and bizarre ways just to get them to a decent default
state. Do we/Can we just compile server after server with just a little
different #define for each possible keyboard?

Assume the worst, that the big-d Default really is unusable for
anything, even the console window, between keyboards, I dunno, say
there's no "x" key given the default mapping (heavens!) And all those
386's are diskless and share off the same X11/bin area for startup,
or really should (consider it a lotsa-workstation management issue
[there you go Barry, kick 'em right in the Athena!])

Clients would be no worse off than they are now and any mechanism to
over-ride the default is unchanged, it's really just a binding time
issue (run-time vs compile-time) rather than a deep philosophical one.

If I rewrote the server in Lisp (ahem) this would be trivial, I just
grab the compiled version and arrange to reload a modified version
from my home directory at startup because it loads my lisp.init file
anyhow, can't help it. It might be a language issue to some extent.

In short, either way you make a real decision, it's unavoidable.

I realize this sounds rather hypothetical, but I get the feeling I
still may be missing something so basic here that it makes me hesitate
to go ahead and write a:

 ReadInKeyMapJustLikeDotHFileButAtRunTimeJustOnceFromUsersPrivateFile()

routine for consideration, I mean, heck, I could get the same effect
using ADB if I were sufficiently drunk and/or crazy, no? Maybe it's
just a user-friendly replacement for a potentially bizarre ADB script?

Small animals will gnaw off their limbs to escape a hunter's trap.

I await reply, I remain open-minded and...

	-Barry Shein, Boston University

bzs@BU-CS.BU.EDU (Barry Shein) (03/15/88)

Ok, I'm convinced, keyboard mapping in the server is a wrong thought
(btw I did read the protocol doc but apparently misunderstood the
subtleties therein.)

I shall now go up upon some mountain and meditate some more...

	"Swift instinct leaps; slow reason feebly climbs"
			-Edward Young



	-Barry Shein, Boston University