Subject: Keyboard related questions
To: None <>
From: Magnus Eriksson <>
List: netbsd-users
Date: 09/18/2007 19:06:38

   I have some keyboard related questions.  These questions are intended to 
lead towards a strange and wonderful optimal multilingual two-keyboard 
setup.  (Or possibly three..)

   And now that all Americans and/or normal people have stopped reading..  :-)

   This is on a "normal PC" system, by the way.  Keyboards involved; PS/2 
Model M, other PS/2 via USB adapter, USB numeric keypad.

   Does anyone have any pointers towards useful information?  What I am 
interested in is the following:

X related:

   * Why there are two(?) mechanisms for remapping keys in X.  (XKB and, 
uh, not-XKB)

   * What the limits are for remapping keys.  (Num Lock, modifiers, etc.)

   * If the LEDs can be remapped.  (Since I'll have more than three; and 
IME state to keep track of)

   * Whether it is possible to have two keyboards simultaneously active, 
with different keymaps.  (remember, in X)

   * Whether X always takes in raw keystrokes, or if it's possible to make 
it accept userland-massaged Unicode (in some form).

IME related:

   * Exactly at which point an Input Method Editor cuts in.

   * And if it's possible to have only *one*, of two attached, keyboard's 
input pass through the IME mechanism.

   * What sort of crash to expect when doing so.  :-)

   * Whether it's possible to have two IME thingys (instances or whatever) 
running at one time.

   * Whether there is an IME that can read a keyboard directly (bypassing 
X), but pass the input on to X.


   * What the underlying idea of a keyboard is in NetBSD (if any).  (From 
what I've seen, the model might be "a component that, together with other 
components, emulates a terminal".)

   * What an attached PS/2 keyboard normally speaks in NetBSD.  (scan code 
set 2?  Probably not important.)

   * What the sequence of events are when a key is pressed.  (from bits on 
the wire to "foo" appearing in an xterm)

   Links, man page pointers, suggestions, and rants are all welcome.  If 
you know of any longer FAQs or texts, that would probably be the best. 
Pointers to source code works too, but it's not my strong side.

   I probably won't be able to answer "but why on Earth would you want to 
do that?" though.  Sorry.