Sic transit gloria keycodi
peter.hutterer at who-t.net
Thu Aug 26 15:34:59 PDT 2010
On Thu, Aug 26, 2010 at 07:44:22PM +0200, Andre Majorel wrote:
> On 2010-08-25 08:31 +1000, Peter Hutterer wrote:
> > On Tue, Aug 24, 2010 at 08:38:33PM +0200, Andre Majorel wrote:
> > > It was apparently decided that evdev should have different
> > > keycodes than the usual. I for one welcome our new keycodes, the
> > > old ones weren't any good anyway.
> > >
> > > Now I need a way to query the X server for which keycodes mean
> > > what, or at least whether it's the traditional set or the evdev
> > > set.
> > >
> > > Is XGetKeyboardMapping() the way to do that ? Its removal is not
> > > in the plans, is it ?
> > In X, a keycode has no meaning other than being an index into
> > the keysym table. Which keycodes are used doesn't matter,
> > XGetKeyboardMapping() is the core protocol approach to
> > obtaining the keysyms (which are what really matters),
> A keycode tells you which key it is.
.. given a specific driver on a specific platform and a specific version of
anything involved. You're not guaranteed that a keycode remains the same,
even between server instances.
"A KEYCODE represents a physical (or logical) key. Keycodes lie in the
inclusive range [8,255]. A keycode value carries no intrinsic information,
although server implementors may attempt to encode geometry information (for
example, matrix) to be interpreted in a server-dependent fashion."
- X Protocol Specification, Page 6.
More information about the xorg