Changing non-printing keys in keyboard layout

Changing non-printing keys in keyboard layout

Dotan Cohen dotancohen at gmail.com
Mon May 9 19:06:22 IDT 2011


Hi all, I'm trying to write a new keyboard layout. I'm testing using
Debian Squeeze and Kubuntu 11.04, both with KDE. It is important to
solve this issue with a keyboard layout as opposed to playing with
xmodmap or scancodes and keycodes because I need to leave the standard
US English, Hebrew, and Russian layouts intact. For the time being the
new layout is called Noah, implemented as a variant of US English. If
this is done more easily by making  whole new layout that is not a
variant of another then I am willing to go that route.

First off, I am trying to move the Caps Lock key to the current
location of the "B" Key. This is my code (the unshown parts of the
files have not been touched):

✈demios:~$ tail /usr/share/X11/xkb/symbols/us -n 68
xkb_symbols "noah" {
 name[Group1]= "USA - Noah Ergonomic";
 include "pc(noah)"
   key <TLDE> { [ 5,             percent     ] };
   key <AE01> { [ 4,             dollar      ] };
   key <AE02> { [ 3,             numbersign  ] };
   key <AE03> { [ 2,             at          ] };
   key <AE04> { [ 1,             exclam      ] };
   key <AE05> { [ Escape                     ] };
   key <AE06> { [ grave,         asciitilde  ] };
   key <AE07> { [ minus,         underscore  ] };
   key <AE08> { [ equal,         plus        ] };
   key <AE09> { [ 6,             asciicircum ] };
   key <AE10> { [ 7,             ampersand   ] };
   key <AE11> { [ 8,             asterisk    ] };
   key <AE12> { [ 9,             parenleft   ] };
   key <BKSP> { [ 0,             parenright  ] };

   key <TAB>  { [ q,             Q           ] };
   key <AD01> { [ w,             W           ] };
   key <AD02> { [ e,             E           ] };
   key <AD03> { [ r,             R           ] };
   key <AD04> { [ t,             T           ] };
   key <AD05> { [ Tab,           Tab         ] };
   key <AD06> { [ bracketleft,   braceleft   ] };
   key <AD07> { [ bracketright,  braceright  ] };
   key <AD08> { [ y,             Y           ] };
   key <AD09> { [ u,             U           ] };
   key <AD10> { [ i,             I           ] };
   key <AD11> { [ o,             O           ] };
   key <AD12> { [ p,             P           ] };
   key <BKSL> { [ slash,         question    ] };

   key <CAPS> { [ a,             A           ] };
   key <AC01> { [ s,             S           ] };
   key <AC02> { [ d,             D           ] };
   key <AC03> { [ f,             F           ] };
   key <AC04> { [ g,             G           ] };
   key <AC05> { [ Return                     ] };
   key <AC06> { [ apostrophe,    quotedbl    ] };
   key <AC07> { [ Return                     ] };
   key <AC08> { [ h,             H           ] };
   key <AC09> { [ j,             J           ] };
   key <AC10> { [ k,             K           ] };
   key <AC11> { [ l,             L           ] };
   key <RTRN> { [ semicolon,     colon       ] };

   key <LFSH> { [ z,             Z           ] };
   key <AB01> { [ x,             X           ] };
   key <AB02> { [ c,             C           ] };
   key <AB03> { [ v,             V           ] };
   key <AB04> { [ b,             B           ] };
   key <AB05> { [ Backspace,     Caps_Lock   ] };
   key <AB06> { [ Super_L,       Super_R     ] };//test these
   key <AB07> { [ backslash,     bar         ] };
   key <AB08> { [ n,             N           ] };
   key <AB09> { [ m,             M           ] };
   key <AB10> { [ comma,         less        ] };
   key <RTSH> { [ period,        greater     ] };

   key <LCTL> { [ Control_L                  ] };
   key <LWIN> { [ Alt_L                      ] };
   key <LALT> { [ Shift_L                    ] };
   key <SPCE> { [ space                      ] };
   key <RALT> { [ Shift_R                    ] };
   key <RWIN> { [ Alt_R                      ] };//test this
   key <RCTL> { [ Control_R                  ] };
};
✈demios:~$
✈demios:~$ tail /usr/share/X11/xkb/symbols/pc -n 4
partial  modifier_keys
xkb_symbols "noah" {
  modifier_map Lock { <AB05> };
};
✈demios:~$


The problem is that this configuration is also affecting the US
English layout. When I press "B" the keyboard gives a B _and_ a Caps
Lock! So typing I get output like this: "keybOARD". How do I restrict
the B key to being Caps Lock only in the Noah layout?

Here is the homepage of the Noah layout:
http://dotancohen.com/eng/noah_ergonomic_keyboard_layout.html

Thanks!

-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com



More information about the Linux-il mailing list