Linux.com

ravindra mudumby--Creating custom keyboard layouts

Posted by: Administrator on June 25, 2005 10:32 AM
XKB is a very powerful system for controlling keyboard layouts on your Linux machine. I do not know how old it is, Jon says it works in Xfree 4.3 as well, but I have only tried it in xorg. It will allow you to set up something like what I have on my computer: my standard qwerty keyboard can switch to Dvorak layout by pressing both shift keys at the same time, and switch back the same way. My scroll lock LED comes on when I am in Dvorak mode, and my caps lock key is now a third control key.

Unlike user xmodmap files, this will affect all users on the system, so avoid doing anything too weird if others use your computer. Also, you need root access to do this, as you will obviously be editing your X configuration scripts.

This is the relavent section of my<nobr> <wbr></nobr>/etc/X11/xorg.conf with the parts I was talking about in the meeting today. The comments I have added should help anybody that wants to try this out. The complete listing and description of various keyboard models, keyboard layouts, and XKB options can be found in<nobr> <wbr></nobr>/etc/X11/xkb/rules/xorg.lst

This should work in newer versions of xfree as well, if you are using that, replace xorg with xfree86 where nessicary and it should work.

If you look around in<nobr> <wbr></nobr>/etc/X11/xkb you should be able to figure out how to create your own rules, and modify existing options and such. For example,<nobr> <wbr></nobr>/etc/X11/xkb/rules/xorg specifies what each group switching option does in terms of scripts in<nobr> <wbr></nobr>/etc/X11/xkb/symbols/group. You can edit this to make your own group switching rules, such as to hit the right windows key, left alt, and right shift to toggle keyboard layouts.

#

Return to Creating custom keyboard layouts for X11 using XKB