Tamil keyboard for X11

In preparing to read Iḷaṅkō Aṭikaḷ’s Cilappatikāram next semester, I wanted to find an easy solution for typing Tamil on Ubuntu. By ‘easy,’ I mean that I did not want to have an entirely new keyboard configuration (I am only getting used to the Kannada configuration now…). It turns out that there weren’t keyboards that mapping the phonetic values of the keys, e.g., the key “p” to the letter ப, and so on. Luckily, the X11 system makes it very easy to add new keyboard configurations. I opened up /usr/share/X11/xkb/symbols/in (the keyboard configuration file for “India”) and added a new configuration that I called “Tamil (Phonetic).” The configuration is below. After adding an entry to /usr/share/X11/xkb/rules/evdev.xml, the configuration was available to the X windows system, and I could choose it in Ubuntu’s input sources menu.

Here is the keyboard mapping:

It has the following features:

  • Generally it maps the English letter to the corresponding Tamil letter, hence t = த, s = ஸ, h = ஹ, j = ஜ, p = ப, m = ம, v = வ, n = ந, l = ல, k = க, and c = ச.
  • For the vowels, generally the key is the combining form of the short vowel (hence i = ி), and SHIFT + the key is the combining form of the long vowel (hence I = ீ).
  • The independent form of the vowels is obtained with the ALT key (the right alt switch key). Hence ALT + i = இ, ALT + SHIFT + i = ஈ.
  • This means that the key i is used for long and short i, in combining and independent forms. Likewise for u, e, and o.
  • a = combining long a (ா), SHIFT + a is independent long a (ஆ), and ALT + a (with or without shift) is independent short a (அ).
  • The halant on the Hindi keyboard that I use is mapped onto f, and since f isn’t used for anything in Tamil, I have also mapped the Tamil puḷḷi onto this letter.
  • SHIFT + t is the retroflex stop (ட).
  • SHIFT + k is the velar nasal (ங); SHIFT + c is the palatal nasal (ஞ); SHIFT + n is the retroflex nasal (ண). For the alveolar nasal (ன) I use ALT + n.
  • SHIFT + l is the retroflex lateral (ள), and ALT + l is the alveolar liquid (ழ).
partial alphanumeric_keys
xkb_symbols "tam_phonetic" {
    name[Group1]= "Tamil (Phonetic)";
    key.type="FOUR_LEVEL";

    // Number row
    key  { [ apostrophe, asciitilde ] };
    key  { [ 1, U0BE7 ] };
    key  { [ 2, U0BE8 ] };
    key  { [ 3, U0BE9 ] };
    key  { [ 4, U0BEA ] };
    key  { [ 5, U0BEB ] };
    key  { [ 6, U0BEC ] };
    key  { [ 7, U0BED ] };
    key  { [ 8, U0BEE ] };
    key  { [ 9, U0BEF, parenleft, parenleft ] };
    key  { [ 10, U0BF0, parenright, parenright ] };
    key  { [ minus, U0BF1, minus ] };
    key  { [ plus, U0BF2 ] };

    // Q Row
    key  { [ U0BCC, U0B94 ] }; // w = au, °au
    key  { [ U0BC6, U0BC7, U0B8E, U0B8F ] }; // e = e, ē, °e, °ē
    key  { [ U0BB0, U0BB1 ] }; // r = r, ṟ 
    key  { [ U0BA4, U0B9F ] }; // t = t, ṭ
    key  { [ U0BAF, U0BC8, U0BC8, U0B90 ] }; // y = y, ai, ai, °ai
    key  { [ U0BC1, U0BC2, U0B89, U0B8A ] }; // u = u, u, °u, °ū
    key  { [ U0BBF, U0BC0, U0B87, U0B88 ] }; // i = i, ī, °i, °ī
    key  { [ U0BCA, U0BCB, U0B92, U0B93 ] }; // o = o, ō, °o, °ō
    key  { [ U0BAA ] }; // p = p
    key  { [ bracketleft, braceleft ] }; 
    key  { [ bracketright, braceright ] };

    //A Row
    key  { [ U0BBE, U0B86, U0B85, U0B85 ] }; // a = ā, °ā, °a, °a
    key  { [ U0BB8, U0BB6, U0BB7, U0BB7 ] }; // s = s, ś, ṣ
    // I am used to f being the halant on the Hindi keyboard, so I put it here.
    key  { [ U0BCD ] }; // f = pulli
    key  { [ U0BB9, U0B83 ] }; // h = h, ḥ
    key  { [ U0B9C ] }; // j = j
    key  { [ U0B95, U0B99 ] }; // k = k, ṅ
    key  { [ U0BB2, U0BB3, U0BB4, U0BB4 ] }; // l = l, ḷ, ḻ
    key  { [ semicolon, colon ] } ; 
    key  { [ apostrophe, quotedbl ] };
    key  { [ U005C, U007C ] };//backslash-bar - Changed to Unicode

   // Z ROW
    key  { [ U0B82 ] }; // x = anusvāra
    key  { [ U0B9A, U0B9E ] }; // c = c, ñ
    key  { [ U0BB5 ] }; // v 
    key  { [ U0BA8, U0BA3, U0BA9, U0BA9 ] }; // n = n, ṇ, ṉ
    key  { [ U0BAE ] }; // m = m, 
    key  { [ comma, less ] }; // , =
    key  { [ period, greater, U0964, U0964 ] }; // . = ., ।
    key  { [ slash, question ] }; // / = ?

    include "level3(ralt_switch)"
};