[Y-devel] keyboard layouts (continued)

Maurice van der Pot griffon26 at kfk4ever.com
Sun Feb 29 23:22:18 GMT 2004


On Sun, Feb 29, 2004 at 11:12:09PM +0100, Rupert Mazzucco wrote:
> On Sun, 29 Feb 2004, Maurice van der Pot wrote:
> 
> > The reason you can look at it as a separate decision tree is that
> > on the logical level the selection processes of modifiers and normal
> > keys are orthogonal.
> 
> That's true, but we still need only a single tree.  If there are rules
> that transform a modifier and one or more "normal" characters into some
> unicode codepoint and move it into the output queue, so can there be
> rules that transform a sequence of normal characters into a modifier and
> move it back into the input queue.  

Hmm... for characters that can be both part of a sequence that generates
a character and a sequence that generates a modifier, there is no choice;
the character _has_ to be part of this single tree. But for modifier-only
keys (like shift in most cases) you don't want shift to be _stored_ as an 
option at every position in the tree even though it _is_ an option at all
times.

So I suppose we really need it to be a single tree and we should be very
careful in choosing an implementation.

> Anyway, the important discovery is that the input driver already performs
> a mapping from raw scancodes to "event codes" according to a map in
> <linux/input.h>, so our discussions about "level 1" are kind of moot; we'll
> have to make do with what we can read from the device, and that is an
> event code (which is basically a keycode if it's a key event) together
> with a timestamp and if it was pressed and released.  With that out of
> the way, we can now concentrate on "level 2". :^)

Take a look at this: https://www.linuxjournal.com/article.php?sid=1080
X gets its raw scan codes by setting a mode of the device. We shouldn't 
do that because it requires root privileges (and that's just one reason), 
but it's possible.

And here's something that's interesting but not really important:

  I was looking at a UK keyboard layout and the key that holds \| (which is 
  located next to the left shift) generates a different key code from any 
  key on a US keyboard (as it should). Also the key with # and ~ (left of 
  the 2 rows high enter) generates the same code as the key with \| on a 
  US keyboard, but _only_ in scan code sets 1 and 2. In 3 it generates 
  something completely different.

Sounds like scan codes already have most of the properties I expect
from key codes. I don't know if the linux kernel still just passes on
the scan codes as key codes without conversion, like it used to. 
If there are keyboards where a key with the same scan code as a key 
on a US keyboard is located somewhere else, then I wonder what keycode 
we will get.

Maurice.




More information about the Y-devel mailing list









2026 © www.Y-Windows.Org - All Rights Reserved