Sunday 8 June 2008

Yoruba Custom Keyboard in Ubuntu

I found it interesting that there was any support at all for yoruba when I first started using ubuntu two years ago. So since I'm not in school this summer and work is getting progressively more boring - i never thot I'd get fed up programming - I decided to spend the better part of this sunday getting the yoruba keyboard working on my system. Here are the steps I took to get it to work:

1. Create a file called yo.
2. Copy the following lines into the file you just created

// $XKeyboardConfig: xkeyboard-config/symbols/gb,v 1.11 2006-10-03 22:25:41 svu Exp $
// based on a keyboard map from an 'xkb/symbols/gb' file
// $XFree86: xc/programs/xkbcomp/symbols/gb,v 1.6 2003/10/04 10:25:14 pascal Exp $

partial default alphanumeric_keys
xkb_symbols "basic" {

// Describes the differences between a very simple en_US
// keyboard and a very simple yoruba keyboard layout defined by ... blah blah blah

include "latin"

name[Group1]="Yoruba Nigeria";

key { [ obelowdot, Obelowdot, q, Q ] };
key { [ U1E63, U1E62, z, Z ] };
key { [ ebelowdot, Ebelowdot, x, X ] };

//grave
key { [ U0340, U0341, v, V ] };
//acute
key { [ U0341, U0340, c, C ] };

include "level3(ralt_switch_multikey)"
};

3. Move the file to /etc/X11/xkb/symbol

- open your terminal
- run the following command. (I'm assuming that the file you just created was stored your desktop). Also note that you may have to specify your admin password to successful complete this command.

sudo mv ~/Desktop/yo /etc/X11/xkb/symbols/yo

4. Append the following lines to the file /etc/X11/xkb/rules/xorg.xml under the layout section


<layout>
<configitem>
<name>yo</name>
<shortdescription>Yo</shortdescription>
<description>Yoruba</description>
</configitem>
<variantlist>
</variantlist>
</layout>

5. Append the following line to the file /etc/X11/xkb/rules/xorg.lst under the ! layout section

yo Yoruba

6. Load the custom keyboard we just created.
- Open System -> Preferences -> Keyboard
- Select the Layouts Tab and Click the Add button. Look for the Layout matching the description you entered in step 4. If you've been following this tutorial verbatim then you should be looking for a layout called Yoruba
- One last thing you may want to do is make sure you know what the shortcut for switching keyboard layouts on your computer is. On my laptop pressing both Alt buttons together switches the keyboard layout. I also added you the MS Icon button. You can edit the shortcut for switching keyboard layouts by clicking the "Layout Options" button and then selecting "Layout Switching". Check/Uncheck whatever keys you wish to use for your shortcuts.
- You can close the keyboard configuration window now.

7. logout and log báck in. (Ctrl-Alt-Backspace if you like)

As always Ubuntu (and X based systems in general) rox.

Ok. Now if you want to know the how and why of all the voodoo that just took place here are a few links you can look up...

http://wikisource.org/wiki/Transwiki:Table_of_Unicode_characters,_32_to_9999
http://people.uleth.ca/~daniel.odonnell/Blog/custom-keyboard-in-linuxx11
http://www.linux.com/articles/113715

http://www.alt-i.org/projects.htm

you'd also want to look up /usr/include/X11/keysymdef.h which contains the key name definitions

On a final note, I've got to say thanks to Daniel O' Donnell for blogging on how to create custom keyboards. Also if you click on the last link I gave above you'd notice that the keymap I used in this tutorial is based on the QWERTY keyboard you've in that project. I figured since they say that they've done their research theirs would be a good example to follow.



I might put up pictures if the need arises but I'm lazy so dont count on it :D



Just for the fun of it... here's some stuff I typed on my keyboard: ... Eniyan ni eyi ṣòro fun; ṣugbọn fun Ọlọrun ohun gbogbo ni ṣiṣe