Talk:Tutorial for Developers: Text Input Methods
The Alt method
The Alt method is available on Windows (some parts only from Windows 98 onwards). Is it available on other platforms? Will it be available on the OLPC laptop?
If the general method is available, what happens with Alt 130 on platforms other than Windows?
The following description relates to Microsoft WordPad.
One needs to do the following.
Make sure that the Num Lock key has been used to switch on Number Lock.
Put the cursor line where the character is needed.
Hold down the Alt key
Using the numbers at the right of the keyboard, key a number.
Release the Alt key.
Provided a suitable number has been chosen for keying, a character will appear provided that there is a glyph for it in the font which is being used.
If the number starts with a 0 or is above 255, then the number is the decimal equivalent of the Unicode hexadecimal code for the character: this can be found using Microsoft Calculator using the View | Scientific mode.
If it is below 256 and does not start with a 0 the number refers to a place in a Microsoft code page. Try 130 and a é character will hopefully appear. Try 142 and a Ä character will hopefully appear.
The Unicode Webspace
The Unicode webspace at http://www.unicode.org is a good source of information about the characters used in the various scripts of the world.
Not on OLPC
Please remember that the OLPC is targetted to children in many countries using many different scripts and keyboard layouts. They will have no need of strange input methods but will type naturally in their native language. If you are developing on another platform such as Windows and you need to enter UNICODE characters you can use the Alt-key and numeric codes as documented in Wikipedia and here.
In addition, Windows and other operating systems have a character map application that allows you to view the full array of Unicode characters available in a given font, as well as copy and paste them. There are also several 3rd party utilities available to do this job.
However, the best way to deal with this is to either install support for the target language and keyboard layout in your OS, or to stick to your native language using gettext for all text strings so that they can be translated later. The Development issues page discusses how to do this.
However, if your goal is merely to test some Unicode data handling, there is a much easier way to enter text. Simply use Google to find sites in target scripts, for instance a Thai newspaper. Then cut and paste from the web browser. This works if you have a good Unicode font like Gentium installed and your browser is configured to use it as the default.
Chinese as a target language needs a special input method to enable the user to input the more than 40.000 different chinese characters. The most common input method used in China is based on the official transliteration standard (Pinyin).
Currently there are different input frameworks for X11, attaching both to X directly (XIM) or to the GTK framework(gtk imm modules).
In case of using GTK, the input method handling transparently for the developer.
Still there are two types of effects, which a developer should keep in mind:
a) in chinese input mode keypresses are not directly send to the application, but are intercepted by the input method and translated into chinese characters (step by step)
b) after the input is finished, a large amount of text is directly pasted into the widget.