Changing non-printing keys in keyboard layout

Dirk Wallenstein halsmit at t-online.de
Mon May 9 01:15:32 PDT 2011


On Mon, May 09, 2011 at 09:33:43AM +0300, Dotan Cohen wrote:
> On Mon, May 9, 2011 at 01:46, Marty Jack <martyj19 at comcast.net> wrote:
> > Look in /usr/share/X11/keysymdef.h at line 128 or thereabouts.  If you don't have that include file, install the X development headers.  This will help you find what the right spelling and capitalization are for anything you are interested in.  Keysyms are case sensitive, even though most things in the keyboard definition are not case sensitive.  I think Escape would work if you had it spelled with a capital E.
> >
> 
> Thanks! The keysymdef.h file is exactly what I had needed as a
> reference. Before that I was scouring google looking for examples!
> 
> 
> > The setup for the modifier keys is in /usr/share/X11/xkb/symbols/pc at line 39 where it assigns the Shift meaning to Shift_L and Shift_R the left and right shift keys.  Shift_L and Shift_R are assigned to keycodes right above there to be whatever the keycodes <LFSH> and <RTSH> are on your keyboard model.  The Caps Lock assignment is there as well.
> >
> 
> This looks like an issue, as I need to change the modifier keys based
> on keyboard layout. I tried to add a new section to ~/symbols/pc like
> this, but either I am calling it wrong or I wrote it wrong:
> 
> partial  modifier_keys
> xkb_symbols "noah" {
>     key <AE05> { [ escape                     ] };
>     key <AB05> { [ backspace,     caps_Lock   ] };
>     key <AB06> { [ Super_L,       Super_R     ] };
>     key <LCTL> { [ Control_L                  ] };
>     key <LWIN> { [ Alt_L                      ] };
>     key <LALT> { [ Shift_L                    ] };
> };
> 
> Then in ~/symbols/us I added new section which calls it like this:
> 
> partial alphanumeric_keys
> xkb_symbols "noah" {
>    name[Group1]= "USA - Noah Ergonomic";
>    include "pc(noah)"
> 
>     key <TLDE> { [ 5,             percent     ] };
>     key <AE01> { [ 4,             dollar      ] };
>     key <AE02> { [ 3,             numbersign  ] };
> ...snip key definitions...
> };
> 
> However, the modifier keys are not changing as I had intended. What
> have I done wrong?

To change modifiers you have to edit the modifier_map entries, too.
They look something like this:

    modifier_map Mod1 { <LALT> };
    modifier_map Shift { <LFSH> };
    modifier_map Control { <LCTL> };
    modifier_map Lock { <CAPS> };

For example, replace the last line with:

    modifier_map Lock { <AB05> };

-- 
Cheers,
  Dirk



More information about the xorg mailing list