The current Solaris Operating System provides a code table input method interface that enables Chinese users to add new input methods into their system.
A code table is a plain text dictionary file that contains a list Chinese characters, words, and phrases that are mapped to input keystrokes. When you type the specified keystrokes, the associated characters, words, and phrases appear for selection.
The code table file contains the following sections:
[Description] This section lists the distinguishing characteristics of the code table.
Name: Code table name.
Encode: UTF-8, GB, GB2312, GBK, or BIG5 encoding used the code table.
WildChar: Wild character used for input codes.
UsedCodes: Valid characters for input.
MaxCodes: Maximum number of input codes for one item.
[Comment]
[Key_Prompt] This section identifies the prompt string of an input key. The prompt string appears in the preedit area of the application subwindow.
[Function_Key] This section describes the behavior specified function keys.
PageUp: Scroll up a list of selection items.
PageDown: Scroll down a list of selection items.
BackSpace: Delete an input code.
ClearAll: Clears all the input areas, such as preedit area and the lookup area.
[Phrase] This section associates input codes with corresponding Chinese phrases. The phrases must be separated by spaces. The format of each line is:keystroke_sequence word1 word2 word3 ....
[Single] This section associates input codes with corresponding Chinese characters. The format of each line is: keystroke_sequence Characterlist. The characters of the Characterlist are not separated by spaces.
[Options] This section specifies the options that you toggle on or turn off for the code table input method.
HelpInfo_Mode: Display help information.
KeyByKey_Mode: Display lookup candidates key by key or only when the spacebar is pressed.
KeyPrompt_Mode: Display the prompt string of the input key in the preedit area.
AutoSelect_Mode: Commit the lookup choice automatically when only a single candidate is available.
SelectKey_Mode: Select numbers, uppercase letters, or lowercase letters.
The following example shows a code table file.
Create and edit the code table source file.
Prepare the code table source file to define the mapping of characters, words, or phrases to input keystrokes.
Convert the source code table file to binary format.
Use the txt2bin utility to convert the code table text file to binary file.
# /usr/lib/im/locale/zh_CN/common/txt2bin \ source_codetable_file binary_codetable_file
You can find the txt2bin and bin2txt are utilities in the directory: /usr/lib/im/locale/zh_CN/common/
Add the code table to the input method specification file, /usr/lib/im/locale/zh_CN/sysime.cfg.
For example, if your new code table binary file is called newim.data, add the entry newim to the input method specification file, sysime.cfg.
Restart the htt input method server by typing the following commands as root.
# /etc/init.d/IIim stop
# /etc/init.d/IIim start
The new input method is ready to use when you log in to the system.