How to load a per-user xkbmap?

martin f krafft madduck at madduck.net
Thu Jun 19 03:19:03 PDT 2008


also sprach martin f krafft <madduck at madduck.net> [2008.05.09.1320 +0200]:
> But it has no effect. None whatsoever.

Original post is here:
  http://marc.info/?l=freedesktop-xorg&m=121033203714703&w=2

I am still nowhere with xkb. The following still does not work:

> $ setxkbmap gb
> $ xkbcomp - :0 <<_eof
> partial default alphanumeric_keys
> xkb_symbols "basic" {
>   include "pc/gb"
> 
>   name[Group1]="Great Britain";
> 
>   key <AE03>  { [         3,   numbersign, threesuperior,    sterling ] };
>   modifier_map Mod3   { <MENU> };
> };
> _eof

It's just a silly test example, but unless I can get that working,
I can't move on. If I press shift-3, I expect the numbersign to be
printed, but I get sterling instead.

Also, Mod3 is not generated when I press the <MENU> key.

I guess the reason must be that I am just defining a 'basic' symbol
map here, but nowhere do I tell xkb to use it.

I thus went for a different approach. If I look at the result of

  xkbcomp :0 xkb

then I see that the xkb_keymap's entry for xkb_symbols
references/defines "pc+gb+ctrl(nocaps)". And in fact, doing

  setxkbmap gb -print

yields

  xkb_keymap {
    xkb_keycodes  { include "xfree86+aliases(qwerty)"     };
    xkb_types     { include "complete"    };
    xkb_compat    { include "complete"    };
    xkb_symbols   { include "pc+gb+ctrl(nocaps)"  };
    xkb_geometry  { include "pc(pc104)"   };
  };

So then maybe I have to modify/extend the "pc+gb+ctrl(nocaps)"
symbol map.

First, however, I'd like to figure out how that's defined in the
first place.

  grep pc+gb -r /usr/share/X11/xkb

yields no results. How is that symbol map created? Is it just the
concatenation of pc (the default being pc105), gb ("basic"), and the
"nocaps" map from the ctrl file?

Anyway, moving on, I figure I can just extend the map by providing
one which includes the other:

  xkb_keymap {
    xkb_keycodes  { include "xfree86+aliases(qwerty)"     };
    xkb_types     { include "complete"    };
    xkb_compat    { include "complete"    };
    xkb_symbols   { include "madduck"  };
    xkb_geometry  { include "pc(pc104)"   };
  };

  partial default alphanumeric_keys
  xkb_symbols "madduck" {
    include "pc+gb+ctrl(nocaps)";
  }

but when I run xkbcomp on that, I get

  syntax error: line 10 of xkb.test
  last scanned symbol is: pc
  Errors encountered in xkb.test; not compiled.

which I just don't understand at all.

What is going on?

What do "partial" and "alphanumeric_keys" define, which I've just
picked up from docs and examples?

How can I override single keys while including all others from the
installed files?

How can I use e.g. Group2 for all of this, and how do I switch to
Group2?

I've read http://www.xfree86.org/current/XKB-Enhancing.html and
http://www.tsu.ru/~pascal/en/xkb and even glanced over
http://www.xfree86.org/current/XKBproto.pdf, but they left me even
more confused.

Is xkb just not something we're supposed to touch? Should I return
to xmodmap? I am not using g* or k*, so I don't have any of these
/fancy/ GUIs to do what I want, nor do I want them since I'd prefer
to understand what's going on.

I would appreciate if someone helped me on this quest.

-- 
martin | http://madduck.net/ | http://two.sentenc.es/
 
"the strength of women comes from the fact
 that psychology cannot explain us.
 men can be analyzed, women merely adored."
                                                        -- oscar wilde
 
spamtraps: madduck.bogus at madduck.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: digital_signature_gpg.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature (see http://martin-krafft.net/gpg/)
URL: <http://lists.x.org/archives/xorg/attachments/20080619/75f22ab2/attachment.pgp>


More information about the xorg mailing list