Re: keysym->keycodes weirdness, with lousy patch

Rahul Jain <[email protected]> Sat, 13 Nov 2004 18:42:45 -0500
Newsgroups gmane.lisp.clx.devel
Message-ID <[email protected]>
Daniel Barlow <[email protected]> writes:

> (I have an irrational prejudice against Xkb, as the only thing it's
> ever done for me is break a previously personally good UK keyboard
> setting.  I need to get over that, obviously; if anyone could point me
> at some good documentation describing what it does, that would
> certainly help)

It allows you to define keyboard layouts in a customizable way. You can
take a complete layout and then add on layout tweaks that do specific
things like swap capslock and control, etc. There are some READMEs in
/usr/lib/X11/xkb.

I have the following in my .xsession:
setxkbmap -model rapidaccess -symbols "us(pc104)+inet(rapidaccess)+parens(easyparens)+ctrl(nocaps)+altwin(super_win)+compose(menu)+local(ctrl_hyper)"

The -model parameter lets you specify the hardware so that stuff like
xkbprint can generate a diagram with your layout on the actual geometry
of your keyboard. The -symbols lets you set up the layout you want. My
base layout is an American pc104 layout. I add the definitions for the
keys that are added in my keyboard model. Then I move aorund delimiters
to make lisping easier and change modifiers to be more useful and the
control key to be easier to get to. I have a few custom layout tweaks
defined: parens(easyparens) and local(ctrl_hyper).

/usr/lib/X11/xkb/symbols/local:
// makes the left ctrl key act as a hyper key
partial modifier_keys
xkb_symbols "ctrl_hyper" {
    key <LCTL> {        [        Hyper_L                ]       };
    modifier_map Mod3   { Hyper_L };
};

/usr/lib/X11/xkb/symbols/parens:
// switch parentheses with square brackets
partial alphanumeric_keys
xkb_symbols "easyparens" {
    key <AE09> {        [         9,    bracketleft     ]       };
    key <AE10> {        [         0,    bracketright    ]       };
    key <AD11> {        [ parenleft,    braceleft       ]       };
    key <AD12> {        [ parenright,   braceright      ]       };
};

HTH
-- 
Rahul Jain
[email protected]
Professional Software Developer, Amateur Quantum Mechanicist


_______________________________________________
Portable-clx mailing list
[email protected]
http://lists.metacircles.com/cgi-bin/mailman/listinfo/portable-clx
cvs -d :ext:cvs.telent.net:/usr/local/src/cvs co clx  # over ssh
cvs -d :pserver:[email protected]:/cvs co clx  # anonymous