OLPC Khmer Keyboard: Difference between revisions
TerryGillett (talk | contribs) (→Gnome Desktop: Changed 13.2.9 to 13.2.7 version.) |
|||
(26 intermediate revisions by 12 users not shown) | |||
Line 4: | Line 4: | ||
{{Keyboard layouts}} |
{{Keyboard layouts}} |
||
:NB: Please be aware that changes to this keyboard are in discussion. See [http://lists.laptop.org/pipermail/localization/2008-October/001656.html this localization list thread]. [[User:Cjl|cjl]] 04:15, 16 October 2008 (UTC). The proposed new keyboard is shown as well as the current keyboard. [[User:Kimquirk|Kimquirk]] 01:46, 3 November 2008 (UTC) |
|||
==Khmer keyboard layout== |
|||
[[Image:KH-MP.png|800px|none|Khmer (first draft)]] |
|||
==Khmer keyboard layout proposal (new)== |
|||
[[Image:KH-MP-v4a.png|800px|none|Khmer (proposed)]] |
|||
==Khmer keyboard layout (current)== |
|||
[[Image:KH-MP-v2.png|800px|none|Khmer (final)]] |
|||
==OLPC section of the XKB symbol file== |
==OLPC section of the XKB symbol file== |
||
A general description of how to change keyboard layouts is available here: [[Localization/Changing_Keyboard_Layout|Changing Keyboard Layouts]] |
|||
To use the XKB Khmer layout along with US layout, you may need to edit <tt>/etc/X11/xorg.conf</tt>. This will make "us" the first and "kh" a second layout: |
|||
To use the Khmer layout along with the standard US layout, edit the <tt> /etc/sysconfig/keyboard </tt> file as follows: |
|||
The original contents of the file look like this: |
|||
XKBMODEL="olpc" |
|||
XKBLAYOUT="us" |
|||
XKBVARIANT="olpc" |
|||
Edit the file (eg with sudo gedit ...) so that it looks like this: |
|||
XKBMODEL="olpc" |
|||
XKBLAYOUT="us,kh" |
|||
XKBVARIANT="olpc2,olpc" |
|||
Notes: |
|||
1. It is necessary to edit the file using sudo. |
|||
2. Do not edit the value of XKBMODEL which may be different to what is shown above. |
|||
Once you have edited and saved the file, restart the XO. Then, when using Sugar, to change the keyboard from US to Kh, press the "Multiply/Divide" key (far right, second row from bottom). |
|||
So if you are using the Write activity in Sugar, you can switch between the keyboard sets by pressing the "Multiply/Divide" key as you enter characters in the document. |
|||
Some keyboards do not have the "Multiply/Divide" key e.g. XO mechanical (non-membrane) keyboards and conventional USB keyboards. For these keyboards you can add an additional key combination to activate the toggle function. |
|||
If you edit the file as below, pressing both Shift keys will activate the toggle function. |
|||
XKBMODEL="olpc" |
|||
XKBLAYOUT="us,kh" |
|||
XKBVARIANT="olpc2,olpc" |
|||
XKBOPTIONS="grp:shifts_toggle" |
|||
It may be convenient to use a script to set up dual keyboard operation when preparing a batch of XO laptops. |
|||
The following snippet illustrates how this can be done: |
|||
echo " Set up the Khmer/English dual language keyboard" |
|||
XKBMODEL=`cat /etc/sysconfig/keyboard | grep "XKBMODEL" ` |
|||
mv /etc/sysconfig/keyboard /etc/sysconfig/keyboard.bak # Backup the file |
|||
echo $XKBMODEL > /etc/sysconfig/keyboard |
|||
echo 'XKBLAYOUT="us,kh"' >> /etc/sysconfig/keyboard |
|||
echo 'XKBVARIANT="olpc2,olpc"' >> /etc/sysconfig/keyboard |
|||
echo 'XKBOPTIONS="grp:shifts_toggle"' >> /etc/sysconfig/keyboard |
|||
cp /etc/sysconfig/keyboard /etc/sysconfig/keyboard.new # Backup the file |
|||
===Gnome Desktop=== |
|||
NOTE: This section only applies for XO Software earlier than 13.2.7. It is not necessary to apply this workaround in 13.2.7 and higher versions. |
|||
For XO software prior to 13.2.7, in dual-language laptops, the toggle key(s) does not work in Gnome by default, because Gnome takes control of keyboard settings, overriding OLPC OS. |
|||
XkbLayout "us,kh" |
|||
XkbVariant "olpc2,olpc" |
|||
To use with Gnome desktop, see [[Release_notes/13.2.6#Keyboard_language_switch_key_does_not_work_in_Gnome|a workaround]]. |
|||
<pre> |
|||
// $XKeyboardConfig: xkbdesc/symbols/kh,v 1.2 2005/12/31 02:02:46 svu Exp $ |
|||
// |
|||
// khmer unicode keyboard for XFree86 4.3 or XOrg |
|||
// (might work with older versions, not tested) |
|||
// |
|||
// layout defined by National Information Communications Technology Development Authority (NiDA) |
|||
// http://www.nida.gov.kh |
|||
// |
|||
// version: 1.0.1 |
|||
// |
|||
// date: 14.09.2005 |
|||
// |
|||
// author: Jens Herden (jens at khmeros.info) |
|||
// |
|||
// |
|||
// understanding the symbols: |
|||
// |
|||
// 0x100yyyy = unicode, yyyy is hexcode |
|||
// codes that are not assigned in unicode (0x10017fb-0x10017ff), |
|||
// are used to make compositions for special vowels |
|||
// |
|||
// voidsymbol = no symbol for this combination |
|||
// |
|||
// all other symbol are defined in: /usr/X11/include/X11/keysymdef.h |
|||
// but with a leading 'XK_' |
|||
// |
|||
Workaround is to open Gnome Terminal, paste this command, and then restart Gnome" |
|||
partial default alphanumeric_keys |
|||
xkb_symbols "olpc" { |
|||
include "kh(basic)" |
|||
// Contact Walter@laptop.org |
|||
// there are four levels defined: |
|||
// |
|||
// normal shift right-alt right-alt + shift |
|||
// |
|||
gsettings set org.gnome.settings-daemon.plugins.keyboard active false |
|||
// keys: `1234567890-=\ |
|||
key <TLDE> { [ guillemotleft, guillemotright, 0x100200d, voidsymbol ] }; |
|||
key <AE01> { [ 0x10017e1, 0x100200c, exclam, 0x10017f1 ] }; |
|||
key <AE02> { [ 0x10017e2, 0x10017d7, at, 0x10017f2 ] }; |
|||
key <AE03> { [ 0x10017e3, 0x10017d1, quotedbl, 0x10017f3 ] }; |
|||
key <AE04> { [ 0x10017e4, 0x10017db, dollar, 0x10017f4 ] }; |
|||
key <AE05> { [ 0x10017e5, EuroSign, percent, 0x10017f5 ] }; |
|||
key <AE06> { [ 0x10017e6, 0x10017cd, 0x10017d9, 0x10017f6 ] }; |
|||
key <AE07> { [ 0x10017e7, 0x10017d0, 0x10017da, 0x10017f7 ] }; |
|||
key <AE08> { [ 0x10017e8, 0x10017cf, asterisk, 0x10017f8 ] }; |
|||
key <AE09> { [ 0x10017e9, parenleft, braceleft, 0x10017f9 ] }; |
|||
key <AE10> { [ 0x10017e0, parenright, braceright, 0x10017f0 ] }; |
|||
key <AE11> { [ 0x10017a5, 0x10017cc, x, voidsymbol ] }; |
|||
key <AE12> { [ 0x10017b2, 0x10017ce, equal, voidsymbol ] }; |
|||
key <BKSL> { [ 0x10017ae, 0x10017ad, backslash, voidsymbol ] }; |
|||
Note: It is important to enter the above command '''without''' using sudo. |
|||
// keys: qwertyuiop[] |
|||
key <AD01> { [ 0x1001786, 0x1001788, 0x10017dc, 0x10019e0 ] }; |
|||
key <AD02> { [ 0x10017b9, 0x10017ba, 0x10017dd, 0x10019e1 ] }; |
|||
key <AD03> { [ 0x10017c1, 0x10017c2, 0x10017af, 0x10019e2 ] }; |
|||
key <AD04> { [ 0x100179a, 0x10017ac, 0x10017ab, 0x10019e3 ] }; |
|||
key <AD05> { [ 0x100178f, 0x1001791, 0x10017a8, 0x10019e4 ] }; |
|||
key <AD06> { [ 0x1001799, 0x10017bd, voidsymbol, 0x10019e5 ] }; |
|||
key <AD07> { [ 0x10017bb, 0x10017bc, voidsymbol, 0x10019e6 ] }; |
|||
key <AD08> { [ 0x10017b7, 0x10017b8, 0x10017a6, 0x10019e7 ] }; |
|||
key <AD09> { [ 0x10017c4, 0x10017c5, 0x10017b1, 0x10019e8 ] }; |
|||
key <AD10> { [ 0x1001795, 0x1001797, 0x10017b0, 0x10019e9 ] }; |
|||
key <AD11> { [ 0x10017c0, 0x10017bf, 0x10017a9, 0x10019ea ] }; |
|||
key <AD12> { [ 0x10017aa, 0x10017a7, 0x10017b3, 0x10019eb ] }; |
|||
===Limitations=== |
|||
// keys: asdfghjkl;' |
|||
key <AC01> { [ 0x10017b6, voidsymbol, voidsymbol, 0x10019ec ] }; // U17B6+U17C6 |
|||
key <AC02> { [ 0x100179f, 0x10017c3, voidsymbol, 0x10019ed ] }; |
|||
key <AC03> { [ 0x100178a, 0x100178c, voidsymbol, 0x10019ee ] }; |
|||
key <AC04> { [ 0x1001790, 0x1001792, voidsymbol, 0x10019ef ] }; |
|||
key <AC05> { [ 0x1001784, 0x10017a2, voidsymbol, 0x10019f0 ] }; |
|||
key <AC06> { [ 0x10017a0, 0x10017c7, voidsymbol, 0x10019f1 ] }; |
|||
key <AC07> { [ 0x10017d2, 0x1001789, voidsymbol, 0x10019f2 ] }; |
|||
key <AC08> { [ 0x1001780, 0x1001782, 0x100179d, 0x10019f3 ] }; |
|||
key <AC09> { [ 0x100179b, 0x10017a1, voidsymbol, 0x10019f4 ] }; |
|||
key <AC10> { [ 0x10017be, 0x10017c8, 0x10017d6, 0x10019f5 ] }; |
|||
key <AC11> { [ 0x10017cb, 0x10017c9, 0x10017c8, 0x10019f6 ] }; |
|||
* On XO laptops with mechanical keyboard, or external USB keyboards, there is no "Multiply/Divide" key, but another key combination can be set up as described above. |
|||
// keys: zxcvbnm,./ |
|||
key <AB01> { [ 0x100178b, 0x100178d, voidsymbol, 0x10019f7 ] }; |
|||
key <AB02> { [ 0x1001781, 0x1001783, voidsymbol, 0x10019f8 ] }; |
|||
key <AB03> { [ 0x1001785, 0x1001787, voidsymbol, 0x10019f9 ] }; |
|||
key <AB04> { [ 0x100179c, voidsymbol, voidsymbol, 0x10019fa ] }; // U17C1+U17C7 |
|||
key <AB05> { [ 0x1001794, 0x1001796, 0x100179e, 0x10019fb ] }; |
|||
key <AB06> { [ 0x1001793, 0x100178e, voidsymbol, 0x10019fc ] }; |
|||
key <AB07> { [ 0x1001798, 0x10017c6, voidsymbol, 0x10019fd ] }; |
|||
key <AB08> { [ voidsymbol, voidsymbol, comma, 0x10019fe ] }; // U17BB+U17C6; U17BB+U17C7 |
|||
key <AB09> { [ 0x10017d4, 0x10017d5, period, 0x10019ff ] }; |
|||
key <AB10> { [ 0x10017ca, question, slash, voidsymbol ] }; |
|||
* On XO laptops running software versions earlier than 13.2.7 it is necessary to apply a workaround to get the keyboard toggle to work in Gnome. |
|||
key <SPCE> { [ 0x100200b, space, 0x10000a0, voidsymbol ] }; |
|||
[[Category: OLPC Cambodia]] |
|||
//language key |
|||
key <I219> { [ ISO_Next_Group, ISO_Prev_Group ] }; |
|||
}; |
|||
</pre> |
Latest revision as of 23:22, 7 June 2018
OLPC keyboard layouts
Instructions for setting up keyboard switching in Terminal are on the Customizing NAND images page. On bilingual XOs, the multiplication/division key is replaced with a keyboard switching key.
Changing the language of the keyboard is independent of changing the language currently displayed. The language currently displayed can be changed by using the Language section of the Sugar Control Panel.
Membrane keyboard layouts
English (US international); Spanish (Latin America); Portuguese (Brazilian); Amharic (Ethiopic); Arabic; Nigerian (Igbo, Hausa, Yoruba); French; Thai; Urdu; Cyrillic (Russian); Turkish; Nepali; Mongolian; Kazakh; Devanagari; Uzbek; Pashto; Dari; Armenian; Khmer; Pulaar; Italian; Kreyòl; German; Chinese (Simplified); OLPC AZERTY
Non-membrane keyboard layouts
Starting with the XO-1.5 HS ("High School") edition, the XO laptop has a traditional (non-membrane) keyboard available as an option: English (US International); Spanish (Latin America);
Blank Keyboard Artwork
Artwork defining the inner dimensions of the membrane keyboard is available here: keyboard-blank.svg
- NB: Please be aware that changes to this keyboard are in discussion. See this localization list thread. cjl 04:15, 16 October 2008 (UTC). The proposed new keyboard is shown as well as the current keyboard. Kimquirk 01:46, 3 November 2008 (UTC)
Khmer keyboard layout proposal (new)
Khmer keyboard layout (current)
OLPC section of the XKB symbol file
A general description of how to change keyboard layouts is available here: Changing Keyboard Layouts
To use the Khmer layout along with the standard US layout, edit the /etc/sysconfig/keyboard file as follows:
The original contents of the file look like this:
XKBMODEL="olpc" XKBLAYOUT="us" XKBVARIANT="olpc"
Edit the file (eg with sudo gedit ...) so that it looks like this:
XKBMODEL="olpc" XKBLAYOUT="us,kh" XKBVARIANT="olpc2,olpc"
Notes:
1. It is necessary to edit the file using sudo.
2. Do not edit the value of XKBMODEL which may be different to what is shown above.
Once you have edited and saved the file, restart the XO. Then, when using Sugar, to change the keyboard from US to Kh, press the "Multiply/Divide" key (far right, second row from bottom).
So if you are using the Write activity in Sugar, you can switch between the keyboard sets by pressing the "Multiply/Divide" key as you enter characters in the document.
Some keyboards do not have the "Multiply/Divide" key e.g. XO mechanical (non-membrane) keyboards and conventional USB keyboards. For these keyboards you can add an additional key combination to activate the toggle function.
If you edit the file as below, pressing both Shift keys will activate the toggle function.
XKBMODEL="olpc" XKBLAYOUT="us,kh" XKBVARIANT="olpc2,olpc" XKBOPTIONS="grp:shifts_toggle"
It may be convenient to use a script to set up dual keyboard operation when preparing a batch of XO laptops.
The following snippet illustrates how this can be done:
echo " Set up the Khmer/English dual language keyboard" XKBMODEL=`cat /etc/sysconfig/keyboard | grep "XKBMODEL" ` mv /etc/sysconfig/keyboard /etc/sysconfig/keyboard.bak # Backup the file echo $XKBMODEL > /etc/sysconfig/keyboard echo 'XKBLAYOUT="us,kh"' >> /etc/sysconfig/keyboard echo 'XKBVARIANT="olpc2,olpc"' >> /etc/sysconfig/keyboard echo 'XKBOPTIONS="grp:shifts_toggle"' >> /etc/sysconfig/keyboard cp /etc/sysconfig/keyboard /etc/sysconfig/keyboard.new # Backup the file
Gnome Desktop
NOTE: This section only applies for XO Software earlier than 13.2.7. It is not necessary to apply this workaround in 13.2.7 and higher versions.
For XO software prior to 13.2.7, in dual-language laptops, the toggle key(s) does not work in Gnome by default, because Gnome takes control of keyboard settings, overriding OLPC OS.
To use with Gnome desktop, see a workaround.
Workaround is to open Gnome Terminal, paste this command, and then restart Gnome"
gsettings set org.gnome.settings-daemon.plugins.keyboard active false
Note: It is important to enter the above command without using sudo.
Limitations
- On XO laptops with mechanical keyboard, or external USB keyboards, there is no "Multiply/Divide" key, but another key combination can be set up as described above.
- On XO laptops running software versions earlier than 13.2.7 it is necessary to apply a workaround to get the keyboard toggle to work in Gnome.