Converting linux keycodes to X keycodes
jeb at jdwilkins.co.uk
Thu Jun 1 01:31:51 PDT 2006
In the end I figured how to rebuild just ati_remote.c from the kernel
so changed it back to emitting KEY_ENTER instead of KEY_OK.
How would I go about using the evdev driver? I've got x11r7 on one
machine and x11r6.9 on the other - which I guess should be the same.
On 6/1/06, Zephaniah E. Hull <warp at aehallh.com> wrote:
> On Thu, Jun 01, 2006 at 09:12:16AM +0200, Marvin Raaijmakers wrote:
> > I made this table for the x86. The following translations are done:
> > |------------------kernel---------------------|-----------X server------------|
> > scancode -> kernel keycode -> scancode related to kernel keycode -> X keycode
> > | |
> > V V
> > +-----------------+ +-------------+
> > | table can be | | Fixed table |
> > | modified using | +-------------+
> > | setkeycodes |
> > +-----------------+
> > So my table translates a kernel keycode to an X keycode. I do not know
> > how the X server does the scancode to X keycode translation, but if this
> > is done by using a fixed table (or 1:1), then the translation from
> > kernel keycode to X keycode can be done by using a fixed table.
> > As you can see the translation from kernel keycode to scancode related
> > to kernel keycode is quite useless, but must be done because xorg only
> > excepts scancodes.
> > So it would be great if there was an input driver for
> > X that wants to receive kernel keycodes (from the evdev driver) and uses
> > them as the X keycodes (so: kernel keycode = X keycode). This is
> > actually the intent of the kernel keycode story in kernel 2.6.
> You just described xf86-input-evdev actually, it works fairly well.
> > Note that a kernel keycode is something like a X keysym for a scancode.
> > So no matter what platform (arm, x86, etc) or keyboard connection (USB,
> > PS/2, etc) you are using, the kernel keycode for key 'a' will always be
> > KEY_A.
> However there are some complications, specificly that the kernel keycode
> mapping is not always 100% accurate.
> This, quite firmly, sucks, but using xkb this becomes a matter of
> 1024D/E65A7801 Zephaniah E. Hull <warp at aehallh.com>
> 92ED 94E4 B1E6 3624 226D 5727 4453 008B E65A 7801
> CCs of replies from mailing lists are requested.
> I've always taken the position that if you can't find anything bad to
> say about a language or an operating system then you don't understand
> it. I also agree with you about the advocacy. AHS. ASS.
> -- Shmuel (Seymour J.) Metz in the Scary Devil Monastery.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.3 (GNU/Linux)
> -----END PGP SIGNATURE-----
> xorg mailing list
> xorg at lists.freedesktop.org
More information about the xorg