A guide to using Ukelele
In this article, you’ll create a custom keyboard layout for Mac OS that you can use to enter special Unicode characters or unsupported languages.
Mac OS has plenty of language options and keyboard layouts out of the box. You can find them by going to System Preferences> Keyboard> Input Sources. Then click on the + plus button to add another.
However, if you speak a minority language or need another special purpose keyboard, you might not be able to find it.
As an example, I am teaching an English phonetics course this term, and although online keyboards like ipa.typeit.org work well, I need a more practical solution for typing the international phonetic alphabet. (IPA) directly on my computer. I also need another keyboard to write traditional Mongolian script, which is not included in the list of supported keyboards by Mac OS.
To create a custom keyboard, you need to create a keyboard layout set. Ukelele will help you do that. It is a program created by the well-known linguistic organization SIL International.
Follow me as I make my IPA keyboard. You can adjust the steps to meet your own needs.
Find Unicode Symbols
Your keyboard will enter Unicode characters, so you need to put together the characters you need first. Here are some places you can do it:
For me, ipa.typeit.org contains most of the special characters that I need:
Download Ukelele from the official site and install it.
When you first open it, it should look like this:
Create a new keyboard layout
This article will teach you how to create a new keyboard layout entirely from scratch. While opening an existing keyboard and editing it can be a faster way to get a finished product, it can be more complicated to figure out when creating a keyboard layout for the first time.
In the menu choose File> New Keyboard Layout.
You will get a pop-up asking you to name your layout. Since I make an IPA keyboard, I will name my own IPA. I want to start from scratch, so I choose Empty as the basic keyboard layout. I want the command shortcuts like Cmd + C to still work, so I will choose QWERTY for the layout with the control key.
hurry Okay to create your layout.
Then in the menu choose File> Save and save it as ipa.keylayout in a location of your choice. You save it now to make sure you don’t lose your work later.
Note: You can also save as a Bundle, but this is not necessary unless you want to do more advanced things like add an icon. For this first keyboard layout, we’ll just use the basic .keylayout extension, which is an XML file.
You can close the original Ukelele window that was displayed when you opened the program for the first time. Just keep the IPA keyboard layout you just created open.
Double-click on a key to modify it
The way to enter a value for a key is to double-click it.
Start by double-clicking on what the a key on most keyboards, then paste into the IPA ɑ value I collected earlier:
press the Finished button to save your change. Your key should now look like this:
You may notice that just clicking a key or pressing a key on your keyboard highlights the key in Ukelele. It does not matter. You can click or press the key again to deselect it. Pressing Shift or Command or any of the other modifier keys will turn it green. You will do this later.
If you want to enter a character by its Unicode value rather than pasting it, you can do so by entering the value in XML format. For example, the Unicode hexadecimal value of
0251. To put that in XML format, you write it like this:
In other words, prefix the value with
&#x and end with
;. (If you are using decimals instead of hexadecimals, leave
x.) This is what entering the hexadecimal value looks like:
Repeat for all empty keys
Double-click on all empty keyboard keys to give them a value. I am using the following values:
Row 1: ` eɪ aɪ aʊ ɔɪ oʊ ɜː ɑr ɛr ɪr ɔr ‿ =
Row 2: ə w ɛ r t ʊ u i o p [ ]
Row 3: ɑ s d f g h j k l ː ˈ
Row 4: z ɝ ʧ v b n m ˌ . /
Row 5: (space)
Note: Don’t forget to add a space to the space bar key!
Save your work with File> Save. The layout looks like this now:
I don’t really care about the right keyboard, but if you want to be complete you can fill it with values like this:
Adding additional values using modifier keys
There are some more Unicode values I want to add but the keyboard is already full. The main way to add more values is to use the modifier keys. These include Shift, Option, Command, Control, and Caps Lock. Use Shift and Option as the first choice because the command can be used for various shortcuts on your computer.
For the IPA keyboard that I am making, I will be able to get all the characters I need by just using Shift. However, you can use Option or Shift + Option to get even more ways to enter characters if you need to.
hurry Offset now. You will notice that the Shift buttons on your Ukelele layout turn green and all of your other key values disappear:
While holding down the Shift key, double-click an empty key to add a value to it. I will add the character æ what a capital would be A on a normal English QWERTY keyboard.
When the keyboard layout is complete, this will allow me to enter æ by pressing the Shift key in combination with this key.
Repeat for all remaining characters using modifiers
By holding down the Shift key and double-clicking on empty keys, add any remaining characters you need.
There are the characters that I still have to add:
Row 2: ʍ e ɾ θ ʊ ɪ ɔ
Row 3: æ ʃ ð ʰ ɫ
Row 4: ʒ ɚ ʤ ʌ ŋ ʔ
After filling in these, the keyboard with the Shift modifier looks like this:
There are a number of blank keys that don’t have anything, but that’s fine with me as they’re just Shift modifier keys.
Save your work again with File> Save.
There are a few steps to follow to install the keyboard.
In Ukelele go to File> Install> Show organizer. You should see your keyboard in the left column.
Write click ipa keyboard element and choose Install for current user:
You will receive the following warning. To choose To close.
As the warning indicates, you should not modify the file after installing it. Installation for the current moved user
ipa.keylayout in the hidden folder
Library/Keyboard Layouts in your personal directory. You can show hidden folders and files in Finder by pressing
Log out and log in
As Ukelele recommends, log out of your current Mac user session and then log back in. You can also restart your computer.
Add your keyboard as an input source
As you saw at the beginning of this article, go to System Preferences> Keyboard> Input Sources. Then click on the + plus button to add another.
Scroll down and choose Other in the list on the left. Then choose the IPA keyboard on the right. Finally, press the Add button.
Note: If you want to associate your keyboard with a specific language, you need to create a collection set rather than a single key layout file.
Choose your keyboard
As long as the input source appears in your toolbar, you can change keyboard layouts by selecting the icon. To choose IPA from the list:
naʊ ju kæn raɪt wɪθ jɝ nu kibɔrd!
You will probably find that you want to make some changes after you finish your keyboard. For example, in that last line of the section above, I had to change the keyboard to enter the
!. It would be nice to add some punctuation in this keyboard.
Uninstall the current keyboard layout
Open Ukelele and go to View> Show organizer.
Then right click ipa and choose Uninstall or just drag it to the Not installed column.
Change the keyboard layout
Since the layout is uninstalled now, you can safely edit it. You can open the file by going to File> Open Recent and choose ipa.keylayout.
Make your changes, then save the file.
Reinstall the layout
In Ukelele go to View> Show organizer still slide ipa Back to Installed for current user column.
To select To close when prompted.
Log out and log in
Log out of your Mac user, then log back in. The changes should have taken effect. Otherwise, try restarting your computer.
You can learn a lot more by reading the documentation. In Ukelele go to Help> Ukelele Manual (PDF). Also check out the tutorials in the Documentation folder in the dmg image you got when you downloaded Ukelele.
From an existing layout
In this article, you created a layout from scratch, but an easier way would be to start with a similar layout and just edit it. An easy way to do this is to go to File> New from current input source. There are also a lot of provisions in the Resources folder included with the Ukelele download. See the documentation for instructions.
More advanced layouts
In addition to modifier keys, you can also configure dead keys to give you even more input options. You can make almost any key a dead key. A dead key is like a modifier key, but when you press it, nothing happens until you press another key. For example, you can do the
` the key adds an accent to the next key.
Share your layout with other people
Anyone can use your layout if they just copy it to the
Library/Keyboard Layouts file from their personal file. For less technical users, Ukelele can also create a dmg file which will help people to install the layout.