[ltp] XKB driver experiments - G41

Peter B. West linux-thinkpad@linux-thinkpad.org
Fri, 17 Jun 2005 23:57:29 +1000


I have ventured into the wilds of XKB once again, and have come out
badly mauled, same as the last time. (2001, Dell Latitude, GB keyboard.)

This time I have a G41 with a US (and Australian) keyboard, and I wanted
an XKB setup tuned to the keyboard; i.e. no Windows or Menu key, an
embedded numeric keypad, no need for navigation keys on the "keypad",
and support for the "internet navigation" keys, of which there are only
Previous Page and Next Page on the G41.

There is more documentation about than there was last time, but it is
still horrendously difficult to graft out any understanding of the way
xkbcomp works in building keymaps.

The notes of Ivan Pascal and Kamil Toman, which are contained in README
files in the XKB distribution, are very useful, but could benefit from a
native English speaker's editing.  Even more useful is "An Unreliable
Guide to XKB Configuration" by Doug Palmer
<http://www.charvolant.org/~doug/xkb/>.  I did not bother with the XKB
protocol specification this time round, as it is of very limited
usefulness in understanding the xkbcomp input files.

My aim was to produce a US keyboard with Compose key (Multi-key)
functionality supporting the most common European character variants.  I
included the iso9995-3 alternate group, because I like having the
European symbols hanging about, but I detest deadkeys.  99.95% of all my
keyboard input is ASCII, so deadkeys just get in the way and have
pernicious side-effects if I'm not watching closely.

On a "default" keyboard setup, Shift-ScrLk actually reports a NumLk
event through xev, and enables the embedded numeric keypad, but seems to
put it into navigation mode.  It seemed to be to do with the fact that
the Shift key was down when NumLk was selected, but I'm not sure.  In
any event, ScrLk is of no use to me, so I decided to try to get ScrLk to
perform the NumLk function to give me a numeric-only keypad.

/usr/X11R6/include/X11/keysymdef.h now contains

#define XK_Prior                0xFF55  /* Prior, previous */
#define XK_Page_Up              0xFF55
#define XK_Next                 0xFF56  /* Next */
#define XK_Page_Down            0xFF56

so I had hopes of mapping PgUp to Page_Up, PgDn to Page_Down, and the
previous-page and next-page internet keys to Prior and Next
respectively, which seems neat and tidy to me.  However, i was unable to
achieve this.  I think the X server insists on being helpful here and
changing my Page_Up/Page_Down back to Prior/Next, which, if true, is
extremely unhelpful.

My beloved Compose key is working, and ScrLk toggles the embedded
numeric keypad.

I had hopes of setting the files up to retain the flexibility of
layouts, variants and options that is available (albeit near-impossible
to trace) in the standard files.  That hope was soon dashed.  I have
constructed a series of "thinkpad" and "tp_" files, based on existing
files, so that no changes need to be made to most of the existing files.
 I have modified one of the standard *.dir files at the xkb top level,
but I don't know whether that is necessary.

The files are available at http://www.users.tpg.com.au/pbwest/thinkpad.tgz

My /etc/X11/xorg.conf contains


    Option "XkbRules"   "thinkpad"
    Option "XkbModel"   "g41_85"
    Option "XkbLayout"  "tp_us"
    Option "XkbVariant" "nodeadkeys"
    Option "XkbOptions" "caps:internal_nocancel"

I would appreciate feedback, and especially improvements in the
generality of the files, without returning to the Byzantine complexity
of the standard files.

Peter
-- 
Peter B. West <http://cv.pbw.id.au/>
Folio <http://defoe.sourceforge.net/folio/>
<http://folio.bkbits.net/> <- the atTridged version