Setting your X11 keyboard layout

Submitted by Swobodin on Fri, 2006-05-26 10:34. ::
Sometimes, you may need more characters than the ones that are available on your keyboard; therefore you look for the specified character in a text that contains it, or a program like charmap, copy the character and paste it, which is not always successful, especially in compatibility Gtk/Qt.
With X11, it's possible to customize your keyboard keys in any language layout you want.
For example: I use a standard US QWERTY keyboard with Arabic letters, but I need some Latin special characters to type in Spanish or so. Hence the need for adding special characters to the keyboard.
To configure your keyboard layout, edit the US International (us_intl) file, which can be found at /usr/X11R6/lib/X11/xkb/symbols/pc/us_intl in earlier Fedora Core versions, and at /usr/share/X11/xkb/symbols/us in Fedora Core 5, where the international layout is included within the main one as a subsection called intl-alt.
Backup the file (who knows?) before editing it.
As you can see, not all keys are listed, only the ones that differ from the standard US layout.
The structure is like the following
Where:
Key setting should be the following:
After you have configured your keys, update your keyboard layout
setxkbmap us_intl
If there's no error, then your configuration should be correct, else check your syntax. If you can't find the nistake (There's no debug here), restore your original file.
If everything goes well, modify to your /etc/X11/xorg.conf
With X11, it's possible to customize your keyboard keys in any language layout you want.
For example: I use a standard US QWERTY keyboard with Arabic letters, but I need some Latin special characters to type in Spanish or so. Hence the need for adding special characters to the keyboard.
To configure your keyboard layout, edit the US International (us_intl) file, which can be found at /usr/X11R6/lib/X11/xkb/symbols/pc/us_intl in earlier Fedora Core versions, and at /usr/share/X11/xkb/symbols/us in Fedora Core 5, where the international layout is included within the main one as a subsection called intl-alt.
Backup the file (who knows?) before editing it.
As you can see, not all keys are listed, only the ones that differ from the standard US layout.
The structure is like the following
key <[code]> { [ lower, upper, metalower, metaupper ] };
Where:
- code is the key code: The key at left below Esc and containing a tilde is called
, the first row is listed from (number 1 and exclaim mark) to (last one before Backspace key). Second row is listed from (Q) to , etc. - lower is the character typed without any extra key.
- upper is the character typed while holding Shift key
- metalower is the character typed while holding meta (Right Alt) key.
- metaupper is the character typed while holding both meta (Right Alt) and Shift keys.
Key setting should be the following:
key { [ apostrophe, quotedbl, dead_acute, dead_diaeresis ] };
After you have configured your keys, update your keyboard layout
setxkbmap us_intl
If there's no error, then your configuration should be correct, else check your syntax. If you can't find the nistake (There's no debug here), restore your original file.
If everything goes well, modify to your /etc/X11/xorg.conf
Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
Option "XkbModel" "pc105"
Option "XkbLayout" "us_intl"
EndSection
I attached my configuration files that you may download and use, copy it to your symbols/pc folder if you run an old Fedora version or insert the lines containing configuration instead of the original ones if running Fedora Core 5.
Recent comments
23 hours 32 min ago
1 week 1 day ago
1 week 5 days ago
2 weeks 1 day ago
3 weeks 3 days ago
3 weeks 4 days ago
6 weeks 2 days ago
7 weeks 2 days ago
7 weeks 4 days ago
8 weeks 1 day ago