Cyrillic Russian Keyboard – A Solution

Well thanks to some help from Tim Fennel via a post I made to the South Birmingham Linux User Group mailing list, I have been able to achieve what I wanted. I am now able to use my Russian keyboard, type in a vowel and then by pressing the Right-Ctrl key and the apostrophe an acute accent is added over the vowel (о́ а́ е́ ы́ ю́ ) as it happens I can now put the accent after any character.

I notice they show up a little too far off to the right here and on other websites. I think this is an affect of how HTML interprets the codes when I post them, but where it matters for me i.e. KDE apps like KWordQuiz they display perfectly.

Following some info from Tim I experimented with a few things and came across this really useful guide by Daniel O’Donnel about keyboard layouts and xkb.

I won’t tell you all the dead ends and time I wasted, the solution came down to this:-

  • I added a third level chooser value for the apostrophe key in the layout file by changing this line :-

key <AC11> { [ Cyrillic_e, Cyrillic_E, ] };

to this

key <AC11> { [ Cyrillic_e, Cyrillic_E, U0301 ] };

U tells xkb it’s a Unicode value that follows and 0301 is the hexadecimal value for a Combining Diacritic Mark for an acute accent.

  • Finally I set the Right Control Key to be the third level chooser key in the KControl Regional & Language settings under the XKB Options tab of the Keyboard Layout section.

Some things I found out the hard way are :-

1) Don’t call your keyboard map anything with underscores in as this is seebs to be used for variants of keyboards. ( I had initially called my new keyboard map in a file called ru_sjs and this kept erroring ).

2) Don’t test your results in a Konsole or other terminal session as this will add another layer of complexity as the terminal emulation can strip of codes etc. use a GUI KDE app or Open Office. (Oh how I laughed when I found out I’d solved the problem an hour before but I was not testing it in the right application.)

Even if you don’t have fancy requirements for non-latin alphabets using the techniques above you can have access to accented English letters for peoples names or borrowed words in English.

Touchе́  Turtle Away!


6 thoughts on “Cyrillic Russian Keyboard – A Solution

  1. mjjohansen, I don’t really have the option to post the file here as an attachment and at 185 lines long it would make a very dull comment.

    However I have mailed you a copy to the email address on your blog. I hope that is ok.

    The file is just the standard one I got by installing the Russian ru in KDE and then changing that one line.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s