Posted: Dec 09, 2006 14:12;
Last Modified: Sep 19, 2025 10:09
Keywords:
This keyboard is now maintained on Github
/usr/share/X11/xkb/symbols/ (mine is here)/usr/share/X11/xkb/rules/evdev.xml (here’s my file)There were a number of problems with using this method in Ubuntu 14 and 15. They seem to be solved now.
As an early medieval English philologist, I make daily use of a number of characters that are not found on the standard US computer keyboard. These include characters and accented letters from various European languages (e.g. ß, é, ä, ø), IPA symbols (e.g. ŋ, ә, etc.), Middle English ȝ, and various letters and forms used in Old English (æ, þ, ċ, ġ, ƿ, ū, ȳ, etc.).
It is possible to gain access to these letters from the character map utility (versions of this are found in all operating systems) or from the "Insert Special Characters" function in my word processor. But for characters I use all the time, this is quite tedious and time consuming. If I am typing Old English, I want to be able to access the "special characters" I use most often from the keyboard. Characters consisting of a single glyph (e.g. æ, ß, þ, ð), I want to be able to enter from the keyboard directly; accented characters (e.g. è, ü, ȳ), I want to be able to build (compose) from their component parts (e.g. type ` and e to get è1 . I also want to be able to use these characters in all programs and utilities on my computer: in my email client, from the command line, in programs and utilities that do not have a "insert special characters" menu item.
Fortunately, it is quite easy in X-11 based Linux distributions to create both custom keyboard layouts (for typing individual characters) and custom compose sequences (for building characters from their component parts)2 .
The following shows how I customised my keyboard and compose sequences in Ubuntu. Ubuntu (or perhaps Gnome?) changed things between Ubuntu 8.04 and 8.10, so you need to do things slightly differently depending on which version you are using. The same techniques should work in other X11-based distributions, although different distributions have the files in different places (see, for example, comment 8 below for Fedora 8).
This material is derived primarily from discussions at the following URLs:In adding material on Ubuntu 8.10, I am indebted to the comments by jv and raek, below. Thanks very much.
Customising the keyboard layout involves four or five steps that vary depending on your distribution:
X11/xkb/symbols/ (here’s my original and my latest). 3 X11/xkb/rules/xorg.xml (here’s mine) and (optionally) X11/xkb/rules/xorg.lst (here’s mine)X11/xkb/rules/evdev.xml (here’s mine)X11/locale/en_US.UTF-8/Compose copied to /home/$USER/.XCompose and modified if necessary (here’s mine)sudo dpkg-reconfigure xkb-data or by deleting the xkm files in /var/lib/xkb and either logging out and back in or just switching to a new layout and back (see here for details)When you design your custom keyboard, you might want to keep some of the national, ISO, or SIL keyboards in mind: there’s no point learning an idiosyncratic keyboard layout if something already exists that covers what you want. For national and ISO standards, the Wikipedia article Keyboard Layout is a good place to start. For SIL, you can start at their resources page
In X11 systems, keyboard layouts are kept in the X11/xkb/symbols directory (in Ubuntu, the full path is /etc/X11/xkb/symbols (≤ Ubuntu 8.04) or /usr/share/X11/xkb/symbols (≥ Ubuntu 8.10); the top level directory may be different in other distributions).
Each of the files in this directory contains a series of entries of the following type:
key <AC01> { [ a, A, aacute, Aacute ] };
This entry maps a key on the keyboard to a number of specific characters using the following conventions:
Creating a custom keyboard map is as easy as replacing the characters you don’t want in a given line with the ones you do. As an early medieval English specialist, I type á and Á much less frequently than I type æ and Æ, for example. To add the Old English characters to my list, I simply replace aacute and Aacute with the entity names or Unicode code points for æ and Æ ("aelig" or U00E6 and "AElig" or U00C6, respectively). Note that in the comments, Jedd Schrock records having difficulty with entity names for some characters, whereas the Unicode points always work; perhaps for anything other than the most common characters, it is just easier to use the code points:
key <AC01> { [ a, A, aelig, AElig ] };
or
key <AC01> { [ a, A, U00E6, U00C6 ] };
When I am finished modifying my keyboard layout, I save the file with a new name (in my case oe in the X11/xkb/symbols directory.
xorg.xml (≤ Ubuntu 8.04)/evdev.xml (≥ Ubuntu 8.10) and xorg.lstIn order to use my new keyboard layout, I need to tell X11 that it exists. X11 keeps track of installed keyboards in one of two configuration files: X11/xkb/rules/xorg.xml (Ubuntu 8.04 and lower) or X11/xkb/rules/evdev.xml (Ubuntu 8.10 and higher) (There is also a file /etc/X11/xkb/rules/xorg.lst that seems to contain similar information; it doesn’t seem to be used in any recent version of Ubuntu).
X11/xkb/rules/xorg.xml (≤ Ubuntu 8.04)To add a keyboard layout to X11/xkb/rules/xorg.xml (i.e. for use in Ubuntu 8.04 and lower):
X11/xkb/rules/xorg.xml in an editor
<layout>
<configItem>
<name> x </name>
<shortDescription> y </shortDescription>
<description> z </description>
</configItem>
</layout>
X11/xkb/rules/evdev.xml (≥ Ubuntu 8.10)To add a keyboard layout to X11/xkb/rules/evdev.xml (i.e. for use in Ubuntu 8.10 and higher):
X11/xkb/rules/evdev.xml in an editor
<layout>
<configItem>
<name> x </name>
<shortDescription> y </shortDescription>
<description> z </description>
<languageList>
<iso639Id> aaa </iso639Id>
</languageList>
</configItem>
<variantList/>
</layout>
X11/xkb/rules/xorg.lst (optional)For sake of consistency, you may want to edit X11/xkb/rules/xorg.lst to reflect the settings in X11/xkb/rules/xorg.xml (As far as I can tell, not doing so does not affect anything, but who knows?).
X11/xkb/rules/xorg.lst in an editor.! layoutX11/xkb/symbols and a long-text description of your keyboard (in my case these are oe and Old English respectively).Note (Jan 2021): I’ve been having trouble with this for a while: I could only access the keyboard menu described below using Gnome Tweaks (it’s no longer available from settings) and nothing I chose there seemed to "stick" — every time I rebooted, the third level choser (and dead key selecter stopped working and the only solution was to go in and reselect it in "Tweaks" (i.e. by selecting a dfferent key, returning, and then saving).
I discovered a solution (don’t remember where), which is to add the following at the end of my keyboard layout (it is now in the layout available from this page:
partial alphanumeric_keys
xkb_symbols "euro" {
include "us(basic)"
name[Group1]= "English (US, euro on 5)";
include "eurosign(5)"
include "level3(ralt_switch)"
};
Since adding this, I’ve had no problems.
Note (March 2021): Myke adds two comments below that suggests that the above code is more than is needed (edited to capture his intention):
I have noticed that many of the standard keyboards integrate the ‘level3(ralt_switch)’ directly from the ‘level3’ package, without the ‘euro’ component. i.e. they include the reference within the layout paragraph, at the very end.
The Italian, for example, has:
key <LSGT> { [ less, greater,guillemotleft,guillemotright] }; include "level3(ralt_switch)" };
as the last line in its ‘basic’ paragraph
I hope to try this out next time I update the keyboard.
What follows is the previous instructions….
The final stage is to designate a "Third Level Chooser" key to allow you to access the characters you have just added to your keyboard. In Gnome-based systems like Ubuntu, this is probably best done from the menu bar:
You should be able to access your custom keys immediately. If you find that they are not working, reset X11 by logging out and back in. At that point they should work fine.
Note: I am not sure is this section (except for assigning a compose key in Gnome) is necessary in Ubuntu 8.10+).
Gnome provides access to hundreds of compose key sequences by default, though getting a list of these sequences can be quite difficult.
While the default key bindings are almost certainly enough for typing most modern languages, you may discover one you need is missing, or wish to use a different set of keys. In such cases, you will need to add or modify the compose key sequences.
Apparently (http://ubuntuforums.org/showpost.php?p=1231373&postcount=2), this list of compose key bindings cannot be edited5 . To get around this, you set the text input method to xim and create a custom list of compose key bindings. This sounds harder than it is:
/etc/environment in an editorexport GTK_IM_MODULE=xim to the end and save. cp /usr/share/X11/locale/en_US.UTF-8/Compose ~/.XCompose; for other locales, see the options available in /usr/share/X11/locale/~/.XCompose in an editor. The file consists of a series of lines that map character combinations to Unicode code points, e.g.
<code><Multi_key> <macron> <U> : "Ū" U016A # LATIN CAPITAL LETTER U WITH MACRON<Multi_key> <minus> <Y> : "ȳ" U0233 # LATIN SMALL LETTER Y WITH MACRON (Tip: this file contains a number of references to characters you probably don’t have set up in your keyboard, such as <macron> in key bindings for characters like ē. In my case, I changed all examples of <macron> to <minus>.The final stage is to designate a "Compose Key" key. This is the key that indicates the next keys are part of a compose key sequence.
You will need to log out and back in before your settings take effect. After you have logged back in, you should be able to use your new compose key sequences.
This no longer (as of 16.04) seems to be necessary. The keyboard loads on reboot.
I’ve had trouble with changes not taking effect. According to this forum entry, the only way of doing this is to eliminate the all the *.xkb files in /var/lib/xkb and then restart the windows manager (in post-Unity versions of Ubuntu sudo restart lightdm). I have since found that the lightdm restart does noting (i.e. starting in in 16.04). A different page suggested using sudo dpkg-reconfigure xkb-data.
I did this by creating a new directory for the old files, then moving them to that directory, then restarting the manager.
It works.
The short answer is that I don’t know: the method discussed here only works with the X11 windows manager, which means only in Linux. But here’s some resources to help you find out how to do this or something similar in other operating systems:
Adding a couple of sites here that are useful:
1 I make this distinction because I don’t type accented characters enough to make it worth my while to treat accented characters as single glyphs. If I found myself typing characters like ü very often, I could easily add them to my keyboard in the same way I add characters like æ or ß.
2 Windows, pre-OS X Macs (and to a lesser extent Mac OS X) handle keyboard mapping differently. Utilities exist that either allow you to create custom keymaps or use keymaps that cover common specialisations (e.g. for linguists who need to type IPA. You can find more about these solutions by searching for terms like "keyboard" "custom" "keymaps" and "Windows" or "Mac".
3 The top level directory for this path varies from distribution to distribution. In Ubuntu ≤ 8.10, the full path is /etc/X11/xkb/symbols/; in In Ubuntu ≥ 9.04 it is /usr/share/X11/xkb/symbols/. There are other changes in the contents of these files. You are better modifying the version on your system than downloading my copies of evdev, etc. The keyboard layout file itself should work fine if you download it. Just make sure you change the name to match the contents of the <name> element in evdev.xml.
4 For reasons that are not clear to me, some programs (most notably Evolution) fail to recognise "Third Level Choosers" if you deselect "Right Alt"—the safest way to go is to use right alt as your third level chooser or make two keys your third level chooser: right alt and some other key of your choosing.
5 Actually I doubt this is true, but the method I’m describing here works for me and proved easier than discovering how to do it within Gnome.
Thank you very much! I searched for a tutorial exactly like this! Mate from Hungary.
Thanks for your tutorial. I’ve used it to define a new layout, but i’m having trouble using combined diacritics to accent all vowels. Do i define the character combinations somewhere else?
Jan,
I’m not sure exactly what the nature of your problem is:
* do you mean that certain combinations of combining diacritics are not working?
* Or that you want to add new combinations that don’t exist
* Or that you want to add precomposed characters to your keyboard layout?
* Or something else?
The thing to keep in mind to start with is that composition and key assignments are different: if you want to get a composed character in one key stroke (with or without a second or third level chooser), you add it to a custom keyboard; if you want to be able to compose on the fly, you use a compose key (different from your third level chooser) and then two other keys—for the diacritic and for the letter it combines with.
If the issue is that you don’t know how to combine certain diacritics with certain letters, all I know is written out above in the section "Customising compose key sequences." I found it a more tedious question of ploughing through ~/.XCompose.
Anyone has done this successfully in Debian? I found out there is no xkb, etc. setting located in the X11 folders. What should I do in order to get it worked under Debian testing?
Many thanks.
I’m assuming you mean pure debian rather than the Ubuntu fork/variant?
I don’t know. I just checked and Ubuntu Feisty still has the directory under /etc/X11. I don’t have a spare computer available to install straight Debian and see what happens.
Been trying to make my own layout it’s got 6 levels (english, latin, greek)
Plus its Dvorak. anything above 4 levels seams to be undocumented so I found the canadian layout which uses 6 levels (8 levels possible) email me at yellow_onion at orcon.net.nz if you want to perhaps update your tutorial and be the first to document it
thanks, i needed some custom layout for Java programming, this is absolute winner tutorial
:)))
in Fedora 8, the path is given by:
/usr/share/X11/xkb/
I reported that “this method doesn’t seem to work in versions 7.10 or 8.04 from a clean install. Part of the problem seems to be that Ubuntu now has the X11 material in two places and uses different names for some of the files.”
But I was wrong: the trouble was I changed the name of the file and it wasn’t loading properly. The method works just fine on new Ubuntu installs of 7.10 and 8.04.
Spectacular! It took me a while to find, but worth every second!
I Used it to change the <MENU> key to a <KPDL> “KP_Delete” key in Ubuntu 8.04
At first I was a little confused how the layout file was tied to the xorg.xml file. I eventually got everything to work, then of course saw Note #4.
Your xorg.xml file has “<name>Old English</name>” instead of “<name>oe</name>” as Note #4 implies.
Thanks very much: I’ve fixed the note.
I have some problem in xml unicode entities....i con’t access some entities and utilities in linux os server pls...help me....mail me to yummy.abu@gmail.com
Sorry. I don’t know what you mean!
I need to define diferent compose keys in diferent for diferent layouts. Could you help me? The same key combination should get č when the Czech is elected, but ĉ, when I am using the layout for Esperanto.
I believe this is possible from within the key layouts themselves, but I confess I don’t know how to do it. You could look through all the various files in the symbol directory looking for compose keys.
But are you sure you want the same key strokes for these? I can see how it might be handy to keep the two accents separate so that you can use them in typing other languages in both keyboards… e.g. French and/or American Phonetic Alphabet.
A follow up: Have you thought of the first approach listed under Linux here: http://www.esperanto.net/veb/faq-14.html
Great information. I am trying to get tengwar (language developed by J.J.R. Tolkien for Lord of the Rings) working on my Ubuntu 8.04 and so far it is going ok. The problem with tengwar is even though fonts are available for the characters, it uses the US standard keyboard. You can activate the fonts (I do this by using gvim and then selecting one of the tengwar fonts I installed in ~/.fonts) and then gvim uses the US standard keys to select which font to display. There is really no keymap. I am going to develope a tengwar keymap that takes into account what the most common tengwar symbol usage frequency.
This is the same concept as the Dvorak keyboard.
anyhow thanks a lot for your article.
As a technical writer, I appreciate how clearly you have explained things. As a dabbler in West African scripts, this will be most useful. Thanks!
I just installed the latest Ubuntu version 8.10 (Intrepid) and have been trying to get these things working. I have found out that the X11 directory has moved to /usr/share/ and that the files evdev.xml and evdev.lst are the right ones to modify now. I still haven’t been able to make new independent layouts show up in Gnome, but only variants. That’s not a big problem, but if someone finds out a way, I would be happy to know about it.
Thank you very much. I’ve just installed a couple of 8.10 versions and haven’t been able to figure out where things are yet.
You’ve seen that the symbols directory is under xkb, right? Presumably that’s where you drop the new layouts.
I also see the old xorg.xml and xorg.lst in that directory. Are you sure changing them doesn't work as of old?
At least the first time I got something new to show up in the Gnome selector was when I added a variant in evdev.xml.
It seems the selection is now based on country or language. I think they used to be just layouts before (but typically named after countries). I also got an independent layout file working by adding a with <span class="caps">ISO</span> country codes in evdev.xml. That way the layout still appears under the chosen country/countries. I’m happy with that, as the panel indicator is now showing my own , which is more descriptive than the country code.
You’re right. I wasn’t able to get anything working in xorg.xml (which is basically the same format as evdev.xml). But I’m not getting things right anyway.
You wouldn’t want to post an example of how you got it to work with the ISO names, would you?
Oh, the xml elements were dropped from my post. Just search for countryList in evdev.xml for an example. There are some japanese, arabic and latin american layouts with countryLists. I added same kind of countryList with the iso3166Id of my home country and found the layout in the corresponding section of the Gnome selector.
Thanks!,
Great ! i was always puzzled by all these configuration files. Very clear tutorial. ThX !
Made for polish letters with a german QWERTZ keyboard.
Did you get it working in 8.10? I haven’t! What did you do?
Thank you very much for this very clear tuto ! It allowed me to type these darned Old Norse names far more easily. Sincere thanks from all the Óláfs !
I managed to get my layout working in Ubuntu 8.10:
1) Place the symbol file in /usr/share/X11/xkb/symbols/.
2) Edit the /usr/share/X11/xkb/rules/evdev.xml file.
3) Add your layout to the file as described in this page.
4) After ‹/description›, add ‹languageList›‹iso639Id› language ‹/iso639Id›‹/languageList›, where language is an existing language code, for example “eng” – English or “art” – Artificial. If you choose a non-existing language id, or omit it all together, your layout won’t appear in the Gnome selector.
(NOTE: i used angle quotes instead of angle brackets in the XML tags in this post due to technical restrictions, so don’t copypaste these characters into your configuration file.)
Thanks for the great tutorial, Dan!
Cannot find the files mentioned on Ubuntu 8.10 :(
Raek… this worked like a charm for me. Thanks very much. I’ve been missing my custom keys since last October!
Daniel: all the files (including those mentioned in Raek’s post) are found on my clean Ubuntu 8.10 install. How are you looking for them? From the command line? In Nautilus? Could it be in this later case that you need to work as root/sudo?
how would one change the third level chooser to the [space-bar] for implementing a one-hand qwerty setup as in:
http://eklhad.net/linux/app/halfqwerty.xkb ?
the space-bar isn’t a choice in ‘layout options’. I’m using hardy-lts, which uses the X11-xkb-utils and not xkbcomp.
Perhaps something in /home/$USER/.XCompose?
I’ve not had much luck overriding gnome, though.
Thanx, great tutorial.
All i could add is the link to language ids referred by reak :
http://www.loc.gov/standards/iso639-2/php/English_list.php
I’ve now updated the instructions to cover ≥Ubuntu 8.10.
Thanks for the tutorial.
My files were in /usr/share/X11.
Thank you very much for this tutorial. Under Ubuntu Jaunty 9.04, I had to modify the file /etc/X11/xkb/base.xml . I described how I made here in french : http://forum.ubuntu-fr.org/viewtopic.php?pid=2627927#p2627927.
Thank you very much. This tutorial make possible to define bashkir layout (russian ciryllic with some original characters) in Linux.
Thanks a lot for this very clear tutorial. I could finally create a Variant with polish letters to my german QWERTZ keyboard.
With the help of your instructions, I managed to design my own keyboard layout for Old Germanic
So: [‘θæŋks]!
An excellent and a very much needed tutorial.
Do you know how to add a new keymap without root privilages?
If you know or find out, would you be so kind to post the instructions? That would be doubly useful as many of us use Linux workstations at various scholarly institutions around the world as ordinary users who cannot modify any of the system files.
I don’t know that, but you’re right that it would be good to know. I’ll keep an eye out to see how one can override system wide settings in one’s own account. It is presumably possible.
Mariusz:
temporarily you can set it by typing “setxkbmap “
or xmodmap
I’m trying to enable putting acute accents on russian (cyrillic) characters. I’ve had problems with the compose key that I won’t go into, so I’m trying to avoid that for now. I’ve had luck with editing the /usr/share/X11/xkb/symbols/ru file, and replacing the semicolon with U0301 (i.e.a non-spacing acute accent).
For some reason, I always have to reload the keyboard after a login, before the accent gets activated, but it works. Now I can accent russian letters by pressing the key and then the semicolon key: о́чень хорошо́!
What I was wondering is if there is a way to input composed unicode characters directly. Xkb throws an error if I try to insert a composed character, e.g. U0061 U0301 instead of, say, U00E1. Is it a matter of a syntax error on my part? Or can you not compose characters directly like that in the config file?
(what I’m after would be to press the third-level key and the cyrillic vowel, and result in an accented cyrillic vowel)
Спаси́бо, Dan!
poacheR – As far as I know, what you want to do is impossible. However, you should be able to put in the single equivalent unicode character in your keymap.
I just stopped to thank Dan for posting these instructions. They still work on Fedora 14. It is possible to use them for either a variant (rules/evdev.xml and symbols/us) or a standalone keymap (rules/evdev.xml and symbols/my_keyfile). During development,I had some errors in my keymap, and the X error messages in the popup weren’t helpful. I ended up booting to runlevel 3, console only, and testing with startx. As a normal user, running the command startx > startx_output 2>&1 . When I logged out of X, I was able to see the error messages saved in the file and fix the problem. Maybe this will help someone else.
Hello,
Thanks so much for this tutorial. It has been the one tool I’ve found useful so far for creating custom keyboards in Ubuntu.
However, I am still having some difficulties. I’ve followed the steps you outline above, up to the third level chooser and Xcompose sections. (the keyboard I am making doesn’t have need for more than two levels). I also added:
cj Chinook Jargonto the !layout section of xorg.lst and xorg.xml.
After I add my layout file to ..X11/xkb/symbols and change the evdev.xml file I get the following error window:
Error activating XKB configuration.
It can happen under various circumstances:
• a bug in libxklavier library
• a bug in X server (xkbcomp, xmodmap utilities)
• X server with incompatible libxkbfile implementation
X server version data:
The X.Org Foundation
11001000
If you report this situation as a bug, please include: • The result of xprop -root | grep XKB • The result of gconftool-2 -R /desktop/gnome/peripherals/keyboard/kbd
I am using Ubuntu 11.04. After I’ve added the cj layout file and listed it in evdev.xml, I go to set my keyboard preference “Chinook Jargon” (that’s my target language). Remarkably, Chinook Jargon does show up as a permissible language, and even when I choose is in the “choose layout” window, the proper layout is displayed on the keyboard graphic. Once I click “add” the error message pops up. This makes me think there are additional steps that I must take to satisfy all of xkb’s requirements.
I tried a workaround to test my layout file. I sudo’ed into ../xkb/symbols/bgr. Opened bgr in gedit, erased the first alphanumeric section, and pasted in the text from my cj layout file. Loaded Bulgarian as a keyboard in the preferences section, and away I typed in Jargon. This confirms that I’m missing a step or two in registering everything correctly within the xkb system.
Would an absent third-level chooser cause this glitch? Xcompose?
Thanks for any thoughts
hayu masi pus munk-tʼsəm ukuk ɬush tʼwax̣-iliʔi!
Thanks! This is exactly what I was looking for :)
First of all, JT, we should meet up: we must be very close to each other and I’m extremely interested in Chinook Jargon.
As to the rest of your questions, I’ll need to check. Hopefully tomorrow.
Hello again!
I thought I’d share a link to the Ubuntu Community Documentation that I just found:
Howto: Custom keyboard layout definitions
It seems to be similar to this page, but not as detailed. It does however point to the files you should edit in recent versions of Ubuntu and has some good links.
Again, thanks for a great tutorial!
Thanks for this very clear tutorial.
I attempted to do as you say under Ubuntu 11.04 (Gnome). I took your file oe and put it in /usr/share/X11/xkb/symbols and modified evdev.xml and evdev.lst as you say.
I did nothing else (no compose ans no third level chooser). Unfortunately after log out and back in again. I can’t find Old English in System > Preferences > keyboard.
Any suggestion would be welcome.
Thanks.
In Ubuntu 14.04, maybe before (I only use LTS releases) the ability to
reassign Level 3 Chooser is no longer available. Probably upstream
Gnome decision. Only workaround that I could find is to run *sudo
dpkg-reconfigure keyboard-configuration* which redefines the
system-wide default.
Also, restarting the window manager is only necessary if you have
changed evdev.xml. If you have only changed files in symbols,
AskUbuntu
says you can type
udevadm trigger —subsystem-match=input —action=change
It goes without saying that you should make a script file for that!
Thank you for the excellent instruction! It was clear and easy to follow. Worked like a charm, too = )
Things like this are the reasons I love linux so much
Hello sir. Can I dump a combination of characters (or a character and a diacritic) together on one key?
Anyone know how to do this on Xubuntu 18.04 or LMDE? Doesn’t seem to work on these.
Still updated… worked great for me.
my Lenovo Ideapad 17 has a broken keyboard.. getting a replacement… really a pain in the rear. I had an external.. but not really a laptop the.. so I decided to mapp normal numeric line AD01 .. AD09 to replace the keys that stppped working.
Finish with a numeric line that uses the 4 columns for map letters, numbers, acute and characters.
One question that could be helpful for others, I could not find what are the positions for the numeric keyboard on the right side, maybe AD15 – AD18 to AF15 – AF18 ?
Did not try it that as with current configuration and while I get a replacement keyboard, I am satisfied with end particular keyboard.
Do you know how are referenced in an EN x11/symbols file standard keyboard?
Thanks.
Hi
I try to added Persian layout on ubuntu xfce4 descktop and I select Win+Space from Change layout option but it changes at first from English to Persian but after that it does not work to switch from Persian to English.
Hi
I try to added Persian layout on ubuntu xfce4 descktop and I select Win+Space from Change layout option but it changes at first from English to Persian but after that it does not work to switch from Persian to English.
Does this still work nowadays? I’m pretty sure I did everything the way you said, however my layout doesn’t show up in the settings.
Thanks.
Joe: Yes, just used it today. Updated the instructions a little, but I don’t quite know how to find the third-level chooser anymore. It just seemed to remember for me. Maybe it’s in the keyboard now? Don’t remember.
Hi Javid. I’m afraid I don’t know the answer: this is one of these things where my knowledge is no reduced to what is written here. It still works for me is all I know.
Good luck and let me know if you do solve it. We can add something here.
Hi Paul,
I’m trying to make a keyboard for typing Chinuk Wawa (Oregon, Native American). I’ve followed the steps you’ve described here, but I’m having some hang-ups.
I’m working in Linux Mint 20. Xedit is the default text editor in Mint.
I created a layout called "chn" and put it in the /x11/../symbols/ folder. I also added my layout to evdev.xml. (doing all of this as root). I am pasting the syntax you show above for the evdev.xml file. When I edit my evdev file, my terminal (where I sudo thunar to get to my root file manager) immediately shows an error message :
It’s like I’m breaking my evdev.xml file by editing it. Maybe I can’t do this in Xedit? Weird. Once I reboot, my chn keyboard does show up in settings->keyboard->layout, but I can’t switch to it. English still works but no switching happens. It’s like X11 acknowledges the file is there but maybe it’s corrupt or something. Anyway, any thoughts you have on this would be greatly appreciated.
Dear Jedd,
Sorry. I’m not sure. Given that it happens immediately, and it’s an xed error, I wonder if you shouldn’t try a different editor, in case this one is trying to add something. I use nano (a bash editor) for a lot of this stuff, or gedit (a more GUI-one, and I’ve never had this issue.
Perhaps report back if you fix it?
Hi Paul,
Thanks for your reply.
Using Gedit did get rid of those errors upon saving. But my keyboard still won’t switch.
I first tried switching to a German keyboard (German layout already in XKB)to make sure switching works generally on my system. No problems there.
Then I installed your oe keyboard (from this page) just to see if I could load a custom keyboard. That also works/switches fine.
So given all this with the fact that my cw (Chinuk Wawa) layout shows up as an option, but switching to it doesn’t work, makes me think there is something wrong with the syntax in my cw.txt layout file.
What glyph names am I supposed to use for the characters? My layout currently has all my special characters listed as Unicode values like U0313 for combining comma above. Maybe XKB has character naming requirements that I don’t know about.
Maybe I’m missing something with commas or other delimiters? Here is a section:
key <AD01> { [ q, Q, Q ] };
key <AD02> { [ w, U02B7, U028D, W ] };
key <AD03> { [ e, U025B, E ] };
key <AD04> { [ r, , R ] };
key <AD05> { [ t, U1D1B, T ] };
Feels like I’m zeroing in on my problem!
Thanks,
Jedd
It works!
I went into my layout file in ../xkb../rules and did some house-cleaning. There were some errant commas without any following unicode values. I also was using tabs in between the commas. I’m not sure which of these changes did the trick, but my keyboard now works.
This is an example of the syntax in my layout file:
key <AD02> { [ w, U02B7, U028D, W ] };
key <AD03> { [ e, U025B, E ] };
key <AD04> { [ r, U025B, R ] };
So in summary what I’ve learned here: do not use tabs to separate items in the layout file, and make sure there are no empty characters between the delimiting commas.
thank you for all your help
Jedd
I think it would be helpful to list somewhere in these instructions appropriate character names to use in the layout file. My experience tells me that "U0301" style (Unicode) naming always works. From other examples I have seen, it appears other users prefer to use names like "exclam" "period" etc. I think it would be helpful to let new users know what acceptable nomenclature is for the layout file.
I tried and tried to get this to work, to no avail. I even emailed Dan. But then I went back and looked at my files, and I found several errors.
1) At first I thought it was because I was using a lot of dead keys and combining diacritics. That turned out not to matter.
2) I had tried putting my keyboard in its own file. Then I tried making it part of the default file, in my case, US. But it never worked. Then I moved it back out into its own file, because that was the one place I knew for sure evdev.xml knew where to find it.
3) I had a malformed line. I had forgot to put "default partial alphanumeric_keys" at the top. That shall not happen to you.
4) I found that it helped to snitch a line from some of the other partial keyboards, ‘include "level3(ralt_switch)" ‘ This goes at the end of the key definitions, indented several steps for clarity.
5) I did have to do a full restart before my changes showed up.
I am a baker and I ought to know better than to make more than one modification to a recipe at once. But I combined several, and so I can’t tell you which of them was causing my diacritics not to appear. But no matter. You have to do them all anyway.
That’s interesting about the level3(ralt_switch). I’ll have to look into that more.
Good Afternoon
Great work, here, although I must say: we linuxers seem to reinvent the wheel over and over and over and… you get the idea. No centralized place to find/add solutions… but I digress from my purpose.
I have noticed that many of the standard keyboards integrate the ‘level3(ralt_switch)’ directly from the ‘level3’ package, without the ‘euro’ component. Would that work for you as well?
— cheers
Hi,
Slight correction: other keyboards include the reference within the layout paragraph, at the very end.
The Italian, for example, has:
key <LSGT> { [ less, greater,guillemotleft,guillemotright] }; include "level3(ralt_switch)" };as the last line in its ‘basic’ paragraph
—cheers
Thanks Myke, for this.
I confess the whole level three key business has always been a bit of a mystery to me: Sometimes it works, sometimes it doesn’t for a while, and then usually it does again after a while. I’ve never really figured out what setting is controlling it and when I do manage to get it right its through something like the GnomeTweaks GUI.
Maybe this is the solution. I’ve never really looked at it. Next time I modify my keyboard, I’ll look at testing this.
Thanks for posting and keeping this article up to date. After reading I stumbled across an X input hackers blog which may be of interest: https://who-t.blogspot.com/2020/09/no-user-specific-xkb-configuration-in-x.html
Had a need recently to mix and match Devanaagri, IPA and English without constantly switching input methods… this guide fit the bill perfectly.
Many thanks!
(Completely off topic, but I’m pretty sure we met and conversed @ a TEI meet.. College Park, ca.2006?)
Do you know if it is possible to insert more than one Unicode character with one keystroke? What I want to do is insert "a" plus the combining macron below (U+0331). I want to do something like this:
key <AC01> { [ a, A, a + 0×1000331, A + 0×1000331 ] };
Obviously the plus sign doesn’t work, and I tried several other things to no avail. Maybe it’s impossible, but if it is possible I would like to know how to do it. Thanks!
I did the same for an African Script (https://cefliberia.org/bassa/). I can’t get it to work in v. 22.04. Have you upgraded to 22.04?
Incredibly helpful – thanks so much for sharing this!
With my own case (working on Linux Mint Debian Edition 6), I had one problem – without any error messages, my layout simply wouldn’t produce the level 3 and level 4 characters (supposed to show up when I used Right-Alt). I managed to fix it by moving the line
> include "level3(ralt_switch)"
inside the block bracketed by
> xkb_symbols "basic" { }
instead of in a separate
> xkb_symbols "euro" { }
block. I eliminated the rest of the "euro" block entirely with no apparent problems.
Don’t know if this is a Debian/Ubuntu thing, or if I was just following the directions poorly.
I look forward to experimenting further. Thanks again!
Hello Dan, thanks for this great tutorial. I’m using Ubuntu 22.04 and I have a French keyboard. So, I looked up the file /usr/share/X11/xkb/symbols/fr with the intent of making a copy of it and editing a few things here and there for my own purposes.
Now this fr file contains code for dozens of different variants for a French keyboard, and I have no idea which one is currently in use on my computer. Do you know how I may determine this ?
Sorry Ewan, I don’t know how to tell. My recollection was that when there are fragments in a file they supplement a different existing file replacing the named entities, but I may be wrong and it’s been a long time since I did the research for this post.
Our University’s Blackfoot name is Iniskim, meaning Sacred
Buffalo Stone.
The University is located in traditional Blackfoot Confederacy territory.
We honour the Blackfoot
people and their traditional ways of knowing in caring for this land, as well as all Aboriginal peoples who have
helped shape and continue to strengthen our University community.
University of Lethbridge | Faculty of Arts and Science | Department of English | School of Graduate studies | RSS Feed
| Site
Administration
© Date of publication or modification by Daniel Paul O'Donnell
Unless otherwise noted, the non-negotiated licence for all work on this site is Creative Commons
Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Creative Commons License.
If you want to use the work in some other fashion, feel free to contact me.