>>>>> "Ivan" == Ivan Pascal <[EMAIL PROTECTED]> writes:

Ivan> 1. Xserver gets key codes from the 'system' keyboard driver.

Here is the issue.  Linux does not pass on the kb's scan codes.  The
input layer, AFAICT, *always* cooks the scancodes into an 8 bit code
per key.  The tables for AT type 2 and AT type 3 kbs are in the file

As an example, the ESC key generates scan code 0x76.  In atkbd.c
that is translated into 1.  That gets passed to X w/o change and
X converts that to keycode 9.  All good.

For VolUp, 0xe0/0x32 goes to 115, 115 somehow gets translated into 48
and X translates 48 into 48+0x78+8 or 176.  Again all is good as xkb
expects keycode 176 for VolUp.

I've also since found that a value in the table in atkbd.c of 92
results in X keycode 129 and that 94 results in keycode 131.  Those
are what inet(inspiron) expects for Play and Prev.  Obviously 92
gets translated to 0xe0/0x01 and 94 to 0xe0/0x03, since those are
what X translates to 129 and 131.

But even though 92 ==> 129 and 94 ==> 131, 93 and 95 do not end up at
130 and 132.  93 must get converted to 0xe0/0x77 as the keycode is
247. As for 95, that ends up with keycode 98....

The steps 2 thru 4 as you described I did grok, in part from your
first reply.  It was helpful.

Ivan> Lets return to your Linux.  If it use non-AT keyboard the Linux
Ivan> keyboard driver anyway emualtes 'raw scan-codes' as if they are
Ivan> got from an AT keyboard.

I haven't found any code in 2.5 (I should say 2.6 now) where a
translation back to raw scan codes occurs.  I was presuming X
was doing that.  The only thing I can find is the tables used
to convert from raw scan codes to the codes corresponding to
the symbols #defined in linux-2.5/include/linux/input.h.

So the question now boils down to:

        How are the linux-2.6 input system keycodes
        translated back to pseudo AT type 2 style
        'raw codes' so that X can convert those
        'raw codes' into X keycodes?

As a side question:  will a driver that just reads
/dev/input/eventX and converts from those codes
directly to xkb symbols be the better option?


Devel mailing list

Reply via email to