Re: [iPAQ] How are keycodes handled? Buttons?

From: Keith Packard <keithp.a.t.keithp.com>
Date: Tue Oct 17 2000 - 00:22:22 EDT

> How is key entry (scribble and XV keyboard) being handled? I know barely
> enough about how X handles keycodes to be dangerous, but I do know there is no
> keysymdef.h file.

As of a week ago, things changed a bit. Here's what we're doing today.

The linux kernel contains a keyboard driver which delivers one byte each
time a key goes up or down; the high bit distinguishes between the two
states. This is in semi-raw mode (rare?), as it parses E0/E1 escapes from
a regular PC keyboard to generate these single byte codes.

The kernel contains a mapping from these numbers to logical keynames
("return", "1", "tab", etc). Each key can have multiple keynames
associated with different shift states.

The X server reads the mapping information from the kernel and constructs
a mapping from these kernel keycodes to X keysyms; for many symbols they
are the same, but for others they are not. the mapping is straightforward
and obvious. Along with this mapping, the X server matches well known
keysyms with modifier bits.

As X keycodes rane from 8 to 255 and kernel keycodes range from 0 to 127,
the server offsets the kernel values by a small amount so that the first
"real" key gets X keycode 8.

All of this seems straightforward, except that the iPAQ has no keyboard
(at least most of the time).

Xscribble converts strokes into X keysyms and then into sequences of X
keycodes (to include modifiers). It then uses the X test extension to
synthesize keypresses with those keycodes so that applications can receive
them.

keithp@keithp.com XFree86 Core Team SuSE, Inc.
Received on Mon Oct 16 21:16:52 2000

This archive was generated by hypermail 2.1.8 : Tue May 04 2004 - 09:43:44 EDT