Difference between revisions of "Spring 2017/Making a keyboard layout"

From LING073
Jump to: navigation, search
(What not to do)
(What not to do)
Line 51: Line 51:
 
[[File:Keyboard layout - xkb Kazakh (with Russian).png|thumb|Kazakh (with Russian)]]
 
[[File:Keyboard layout - xkb Kazakh (with Russian).png|thumb|Kazakh (with Russian)]]
 
[[File:Keyboard layout - xkb Russian.png|thumb|none|Russian]]
 
[[File:Keyboard layout - xkb Russian.png|thumb|none|Russian]]
 +
<br />
 
[[File:Keyboard layout - xkb Russian (Kazakhstan, with Kazakh).png|thumb|none|Russian (Kazakhstan, with Kazakh)]]
 
[[File:Keyboard layout - xkb Russian (Kazakhstan, with Kazakh).png|thumb|none|Russian (Kazakhstan, with Kazakh)]]
 +
<br />
  
 
== Assignment ==
 
== Assignment ==

Revision as of 19:37, 21 January 2017

Classroom activities

Using a keyboard already on your system

The desktop environment that the virtual machines logs in to is Cinnamon, which is based on Gnome2. The instructions here will assume that this is what you're using, though there are a number of other linux desktop environments out there, where these instructions may need to be tweaked a bit.

  1. Open keyboard settings. One way to do this is to right click on an empty part of the panel/bar at the bottom of the screen and click "All Settings"; then find "Keyboard". (Alternatively, just click the "Menu" button at the bottom left and type "Keyboard" and press enter.)
  2. Go to the "Keyboard layouts" tab and add ("+" button) a layout of your choice. Something obviously different from the US English layout (like Russian or Hebrew) might be good for testing.
  3. Set up three keys: an Alt-Gr / 3rd level key (recommended: right ‹Alt›), a compose key (recommended: left Windows key), and a layout-switching key (recommended: ‹Caps Lock› OR left ‹Alt›+‹Shift›). In the Keyboard layouts window, click "Options..." (bottom right), and find the following (respectively): "Key to choose 3rd level", "Position of Compose key", and "Switching to another layout".
  4. Test your keys in a text editor.
    • You can preview your keyboard to see if 3rd-level options exist (they're to the left of the normal key values), and if they don't, you can try adding a keyboard layout like "Russian (Kazakhstan, with Kazakh). Then ‹Alt-Gr› + ‹f› should print "ә" (Cyrillic [æ] letter).
    • Using an English keyboard layout, you can test your Compose key as follows: press ‹Compose› once, press ‹e› twice; this should print "ə" (Latin-alphabet schwa letter). Try other combinations, like ‹Compose› + ‹t› + ‹h›, or ‹Compose› + ‹=› + ‹E›.

Adding an existing xkb layout to your system

For this exercise, you're going to download and install a Latin-alphabet layout I made that supports several Turkic languages as well as quite a bit of IPA.

  1. Download the tks file listed in my keyboard repo on github. You can click on the file, and the click raw, and save that, or you can simply use a terminal by typing something like wget https://raw.githubusercontent.com/jonorthwash/keyboards/master/xkb/tks.
  2. Put the tks file in /usr/share/X11/xkb/symbols. You can use the cp command to do it, and you'll probably need to use sudo too. E.g. sudo cp tks /usr/share/X11/xkb/symbols/
  3. Add a layout entry in the /usr/share/X11/xkb/rules/evdev.xml file for the layout. To do this, edit that file with your favourite text editor (again, you'll probably need sudo), and search for the end of the layoutList section by searching for </layoutList> in the file. Copy a simple layout block from above that line, paste it in as a new layout block (between the last </layout> and </layoutList>and modify it for this layout. You can use something like this:
        <layout>
          <configItem>
            <name>tks</name>
            <shortDescription>tks</shortDescription>
            <description>Jonathan's Turkic and IPA layout</description>
            <languageList><iso639Id>eng</iso639Id><iso639Id>tur</iso639Id></languageList>
          </configItem>
        </layout>
    
  4. Save the file, exit the editor, and restart cinnamon. The quickest way to do this is to run cinnamon --replace on the command line.
  5. Go back to your keyboard layout settings, and you should be able to find the layout under "Jonathan's Turkic and IPA layout" in the list.
  6. Note: now when you switch layouts, you'll notice that this layout has no flag associated with it in the keyboard selector on the bottom panel. Since flags are not languages (and certainly aren't keyboard layouts), this is kind of silly, and might be good to disable. To do this, simply right click on the keyboard layout selector, click "Configure..." and uncheck "Use flags to display keyboard layouts".

Issues to consider

Technical issues

  • Many-character input (e.g., kana)
  • Compose key versus

Design issues

  • What to base your input method on
    • Is there a layout used in the region that already has all the characters available? Or is one character short?
  • Use of other languages

What not to do

  • Which of these xkb keyboard layouts do you think Kazakh speakers in Kazakhstan prefer to use to type Kazakh, and why? The "Russian" layout is the modern standard Russian keyboard layout, and the "Kazakh" layout has been available in Windows for at least 15 years or so. Almost all Kazakh speakers in Kazakhstan also speak Russian (but not all Russian speakers in Kazakhstan also speak Kazakh).
Kazakh
Kazakh (with Russian)
Russian


Russian (Kazakhstan, with Kazakh)


Assignment