#
# Nigerian keyboard
# - in default "basic" layout, the diacritics are unicode modifiers,
#   that is, they have to be typed _after_ the letter they modify
# - you can use "deadkey" layout if you want dead keys, that is, to
#   type the diacritics _before_ the letter they modify; note however
#   that diacritics that go below the letter don't have dead keys defined
#   on X11 (with the exception of cedilla, ogonek (not used here)
#   and belowdot)
#

partial default alphanumeric_keys
xkb_symbols "basic" {

    include "us(basic)"

    name[Group1]="Nigerian";

    key <AE03> { [         3,  numbersign,  sterling ] };
    key <AE04> { [         4,       U20a6,    dollar ] };
    key <AE05> { [         5,     percent,  EuroSign ] };
    key <AE08> { [         8,    asterisk,  U0324 ] }; // below diaeresis
    key <AE09> { [         9,   parenleft,  U0323 ] }; // below dot
    key <AE10> { [         0,  parenright,  U0331 ] }; // below macron
    key <AE11> { [     minus,  underscore,  U0327 ] }; // cedilla ?
    key <AE12> { [     equal,        plus,  U0330 ] }; // below tilde ?

    key <AD03> { [ e, E, U1eb9, U1eb8 ] }; // ẹ
    key <AD04> { [ r, R, U01dd, U018e ] }; // ǝ
    key <AD06> { [ y, Y, U01b4, U01b3 ] }; // ƴ
    key <AD07> { [ u, U, U1ee5, U1ee4 ] }; // ụ
    key <AD08> { [ i, I, U1ecb, U1eca ] }; // ị
    key <AD09> { [ o, O, U1ecd, U1ecc ] }; // ọ
    key <AD11> { [  bracketleft,   braceleft, U0300 ] }; // grave
    key <AD12> { [ bracketright,  braceright, U0301 ] }; // acute

    key <AC02> { [ s, S, U1e63, U1e62 ] }; // ṣ
    key <AC03> { [ d, D, U0257, U018a ] }; // ɗ
    key <AC08> { [ k, K, U0199, U0198 ] }; // ƙ
    key <AC09> { [ l, L, U0254, U0186 ] }; // ɔ
    key <AC10> { [    semicolon,       colon, U0303 ] }; // tilde ?
    key <AC11> { [   apostrophe,   quotedble, U0302 ] }; // circumflex
    key <BKSL> { [    backslash,         bar, U030c ] }; // caron

    key <AB02> { [ x, X, U1e0d, U1e0c ] }; // ḍ
    key <AB05> { [ b, B, U0253, U0181 ] }; // ɓ
    key <AB06> { [ n, N, U1e45, U1e44 ] }; // ṅ
    key <AB07> { [ m, M, U014b, U014a ] }; // ŋ
    key <AB08> { [        comma,        less, U0307 ] }; // above dot
    key <AB09> { [       period,     greater, U0308 ] }; // diaeresis
    key <AB10> { [        slash,    question, U0304 ] }; // macron

    include "level3(ralt_switch)"
};

partial alphanumeric_keys
xkb_symbols "deadkeys" {

    include "ng(basic)"

    name[Group1]="Nigerian";

    key <AE08> { [         8,    asterisk,  x ] }; // dead below diaeresis
    key <AE09> { [         9,   parenleft, dead_belowdot ] }; // dead belowdot
    key <AE10> { [         0,  parenright,  x ] }; // dead below macron
    key <AE11> { [     minus,  underscore,  dead_cedilla ] }; // dead cedilla ?
    key <AE12> { [     equal,        plus,  x ] }; // dead below tilde ?

    key <AD11> { [  bracketleft,   braceleft, dead_grave ] };
    key <AD12> { [ bracketright,  braceright, dead_acute ] };

    key <AC10> { [    semicolon,       colon, dead_tilde ] }; // dead tilde ?
    key <AC11> { [   apostrophe,   quotedble, dead_circumflex ] };
    key <BKSL> { [    backslash,         bar, dead_caron ] };

    key <AB08> { [        comma,        less, dead_abovedot ] };
    key <AB09> { [       period,     greater, dead_diaeresis ] };
    key <AB10> { [        slash,    question, dead_macron ] };

};

partial alphanumeric_keys
xkb_symbols "phonetic" {

    name[Group1]="Nigerian";

    key <TLDE> { [ dead_acute, dead_tilde      ]	};
    key <LSGT> { [ dead_grave, dead_circumflex ]	};

    key <LatB> { [ b, B, U0253, U0181 ] }; // ɓ
    key <LatD> { [ d, D, U0257, U018a ] }; // ɗ
    key <LatE> { [ e, E, U1eb9, U1eb8 ] }; // ẹ
    key <LatI> { [ i, I, U1ecb, U1eca ] }; // ị
    key <LatK> { [ k, K, U0199, U0198 ] }; // ƙ
    key <LatN> { [ n, N, U1e45, U1e44 ] }; // ṅ
    key <LatO> { [ o, O, U1ecd, U1ecc ] }; // ọ
    key <LatS> { [ s, S, U1e63, U1e62 ] }; // ṣ
    key <LatU> { [ u, U, U1ee5, U1ee4 ] }; // ụ
    key <LatY> { [ y, Y, U01b4, U01b3 ] }; // ƴ
 
    include "level3(ralt_switch)"
};


