[Y-devel] keyboard layouts (continued)

Rupert Mazzucco maz at ap.univie.ac.at
Sun Feb 29 22:12:09 GMT 2004


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.  Or into the output queue, if somebody
really insists.  What we regard as "modifier" and as "normal character"
is really a bit artificial, although a useful convention.

Something more practical:  Today I looked a bit into the Linux input
driver.  Obviously we are supposed to use those /dev/input/event?
devices.  I find one for my keyboard and one for my mouse, so there is
no pressing need to handle both types of events together, though it
might still be useful to do so.

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". :^)

I don't know how BSD does it; I looked on a Darwin installation, which
is the closest thing to FreeBSD I can get my hands on, but didn't find
anything.  In Darwin it's probably handled by this IOKit?

Last point:  The Linux input driver obviously developed from a USB driver,
so they are heavily influenced by this Human Device Interface (HDI) model
of USB.  The good thing is that this is heavily documented on www.usb.org,
so there are a lot of ideas we can rip off. ;-)  I'm not done with reading
all the PDFs, though.  (o be honest, I haven't even started.)

Regards,
Rupert




More information about the Y-devel mailing list









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