Layout definition code#
The two letter country code for Haiti is "ht", so following in the footsteps of all the other layouts that people ahve made in the symbols directory, let's use that name: cd /usr/share/X11/xkb To create a new layout from scratch we have to create our own symbols file. Even though my understanding is certainly basic. I can't find any references for a proper layout so I'm going to be using my personal understanding of haitian to guide the design. Kreyòl Asisyen, as it is called, is not supported by default, although oddly Latin American layout for Haitian is supported. Note that you may also have to clear the pre-compiled keymaps before your modifications work: cd /var/lib/xkb/įor this exercise we're going to create a layout for Haitian Creyole. Key Īpplying the change to the proper section should then make the customization work. To do this, first you need to find the keyboard layout file you are using - in this case, it would typically be the /usr/share/X11/xkb/symbols/es file. You might then opt to place the tilde accent on the ñ key, because it has that symbol printed right on the key (albeit over the "n"). See the External Links section for a general overview of XKB and more.įor example, suppose you have a Spanish language keyboard and want to add a dead key for the tilde accent for chatting with your Brazilian friends. Ignoring "XK_" part after each definition, the remainder of the word may be used in your layouts (for the sterling symbol, it says #define XK_sterling ., so you would use sterling in your layout). Dead keys, signs, and a large repertoire or characters, such as the "at" sign, have a descriptive name that can be entered in place of finding the Unicode character directly - these are defined in /usr/include/X11/keysymdef.h.
Numbers and the standard alphabet may be entered directly. The output from layout files can be any Unicode character (see this Wikipedia entry), and are entered with the U and without the leading + sign, as for example U0282. These steps are currently beyond the scope of this document.
You can do this by adding the file to the symbols.dir, and adding a line for the file in rules/evdev.lst under the !layouts section. If you use other X11 wms you may want to give your layout to the rest of the xorg system.
Adding a new layout requires that you also add the file to rules/evdev.xml. Layouts are kept in the symbols directory therein: they are generally named by a two letter country code associated with the language for which the layout is designed.Įditing a layout is as simple as locating the correct file in the symbols directory and editing the file. In current Ubuntus, the default directory is not /etc/X11/xkb but rather /usr/share/X11/xkb. The basic keyboard mapping package is XKB. ~/.XCompose - custom XCompose keys (need to define QT/GTK_IM_MODULE) usr/share/X11/locale/ - XCompose compose keys usr/share/X11/locale/compose.dir - XCompose-style mappings directory usr/share/X11/XKeysymDB - compose-style keysyms usr/include/X11/keysymdef.h - Xorg keysyms usr/share/X11/xkb/keycodes/evdev - defintion of keys on keyboard This tutorial will introduce you to the basics of modifying and creating custom keyboard layouts for use with the system-standard gnome-keyboard-properties application (usually accessed through System->Preferences->Keyboads).