2

Due to medical reasons four years ago I had to switch to Dvorak keyboard. Back then I was using Windows and created a custom keyboard layout for Khmer language (I'm a native) myself, but now I'm on Ubuntu and couldn't get it to work myself, even after reading this and this. Here's the code for symbols with Unicode characters:

default  partial alphanumeric_keys
xkb_symbols "basic" {
    name[Group1]= "Khmer (Dvorak)";

// there are four levels defined:
//
//                 normal           shift           right-alt   right-alt + shift
//

//  keys: `1234567890-=\
    key <TLDE> { [ guillemotleft,   guillemotright  ] };
    key <AE01> { [ 0x10017e1,       exclam  ] };
    key <AE02> { [ 0x10017e2,       0x10017d7,      at,     voidsymbol  ] };
    key <AE03> { [ 0x10017e3,       quotedbl,       0x10017d1,  voidsymbol  ] };
    key <AE04> { [ 0x10017e4,       0x10017db,      dollar,     voidsymbol  ] };
    key <AE05> { [ 0x10017e5,       percent,        EuroSign,   voidsymbol  ] };
    key <AE06> { [ 0x10017e6,       0x10017cd,      0x10017d9,  voidsymbol  ] };
    key <AE07> { [ 0x10017e7,       0x10017d0,      0x10017da,  voidsymbol  ] };
    key <AE08> { [ 0x10017e8,       0x10017cf,      asterisk,   voidsymbol  ] };
    key <AE09> { [ 0x10017e9,       parenleft,      braceleft,  voidsymbol  ] };
    key <AE10> { [ 0x10017e0,       parenright,     braceright, voidsymbol  ] };
    key <AE11> { [ 0x10017c0,       0x10017bf,      0x10017a9,  bracketleft ] };
    key <AE12> { [ 0x10017aa,       0x10017a7,      0x10017b3,  bracketright    ] };
    key <BKSL> { [ 0x10017ae,       0x10017ad,      backslash,  voidsymbol  ] };

//  keys: qwertyuiop[]
    key <AD01> { [ 0x10017cb,       0x10017c9,      0x10017c8,  voidsymbol  ] };
    key <AD02> { [ 0x10017bb 0x10017c6, 0x10017bb 0x10017c7,    comma,      voidsymbol  ] };
    key <AD03> { [ 0x10017d4,       0x10017d5,      period,     voidsymbol  ] };
    key <AD04> { [ 0x1001795,       0x1001797,      0x10017b0,  voidsymbol  ] };
    key <AD05> { [ 0x1001799,       0x10017bd,      voidsymbol,     voidsymbol  ] };
    key <AD06> { [ 0x1001790,       0x1001792,      voidsymbol, voidsymbol  ] };
    key <AD07> { [ 0x1001784,       0x10017a3,      voidsymbol, voidsymbol  ] };
    key <AD08> { [ 0x1001785,       0x1001787,      voidsymbol,     voidsymbol  ] };
    key <AD09> { [ 0x100179a,       0x10017ac,      0x10017ab,  voidsymbol  ] };
    key <AD10> { [ 0x100179b,       0x10017a1,      0x10017d8,  voidsymbol  ] };
    key <AD11> { [ 0x10017ca,       question,       slash,      voidsymbol  ] };
    key <AD12> { [ 0x10017b2,       equal,          0x10017ce,  voidsymbol  ] };

//  keys: asdfghjkl;'
    key <AC01> { [ 0x10017b6,       0x10017b6 0x10017c6,    0x10017a8,  voidsymbol  ] };
    key <AC02> { [ 0x10017c4,       0x10017c5,      0x10017b1,  voidsymbol  ] };
    key <AC03> { [ 0x10017c1,       0x10017c2,      0x10017af,  voidsymbol  ] };
    key <AC04> { [ 0x10017bb,       0x10017bc,      voidsymbol, voidsymbol  ] };
    key <AC05> { [ 0x10017b7,       0x10017b8,      0x10017a6,  voidsymbol  ] };
    key <AC06> { [ 0x100178a,       0x100178b,      voidsymbol, voidsymbol  ] };
    key <AC07> { [ 0x10017d2,       0x10017a0,      voidsymbol, voidsymbol  ] };
    key <AC08> { [ 0x100178f,       0x1001791,      0x100179d,  voidsymbol  ] };
    key <AC09> { [ 0x1001793,       0x100178e,      voidsymbol, voidsymbol  ] };
    key <AC10> { [ 0x100179f,       0x10017c3,      0x10017db,  voidsymbol  ] };
    key <AC11> { [ 0x10017a5,       0x10017cc,      minus,      voidsymbol  ] };

//  keys: <zxcvbnm,./
    key <LSGT> { [ minus,       underscore,     voidsymbol, voidsymbol  ] };
    key <AB01> { [ 0x10017be,       0x10017c4 0x10017c7,    0x10017d6,  voidsymbol  ] };
    key <AB02> { [ 0x1001786,       0x1001788,      0x10017dc,  voidsymbol  ] };
    key <AB03> { [ 0x1001789,       0x10017c7,      voidsymbol, voidsymbol  ] };
    key <AB04> { [ 0x1001780,       0x1001782,      voidsymbol, voidsymbol  ] };
    key <AB05> { [ 0x1001781,       0x1001783,      voidsymbol,     voidsymbol  ] };
    key <AB06> { [ 0x1001794,       0x1001796,      0x100179e,  voidsymbol  ] };
    key <AB07> { [ 0x1001798,       0x10017c6,      voidsymbol, voidsymbol  ] };
    key <AB08> { [ 0x10017b9,       0x10017ba,      0x10017dd,  voidsymbol  ] };
    key <AB09> { [ 0x100179c,       0x10017c1 0x10017c7,    voidsymbol,     voidsymbol  ] };
    key <AB10> { [ 0x100178b,       0x100178d,      plus,       voidsymbol  ] };

    key <SPCE> { [ space,       0x100200b,      voidsymbol, voidsymbol  ] };
    key <RALT> { [ Alt_R    ] };

// third level with right-Alt
    include "level3(ralt_switch)"

};

I have some doubts with the two consonants in one click. There are some compound vowels that are formed by two separate vowels but have no Unicode characters to represent them as one. Windows seems to have some Unicode characters for these but they don't work in Ubuntu, giving square blocks instead. Not sure if I'm doing it right by putting the two vowels separated by a space like in the code above.

It'd also be better if I can use caps lock to switch to standard American Dvorak layout, if possible. Any kind folks can help me with this?

  • 1
    To set a keyboard shortcut which will switch the keyboard layout, go to System Settings > Keyboard > Shortcuts > Typing. It won't accept Caps Lock, so I would recommend to use Super+Space, which is the same as on Windows. Also, to get those Unicode characters to render properly, you might need to install an additional Khmer font. – wjandrea May 28 '16 at 4:55
  • 1
    you don't get what I mean... In Windows I can make a layout that can give different characters when Caps lock is on. Anyway, it's not that important; the important thing is I want a custom layout using the codes I already put above. – Manuth Chek May 30 '16 at 1:32

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.