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 describes the following attributes 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 specifies the prompt string of an input key. The prompt string appears in the preedit area of the application subwindow.
[Function_Key] This section specifies the key definitions of certain 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 specifies the input codes and the corresponding phrases. The Chinese phrases must be separated by spaces. The format of each line is keystroke_sequence word1 word2 word3 ...
[Single] This section specifies the input codes and the corresponding Chinese characters. The format of each line is keystroke_sequence Characterlist. The Characterlist characters are not separated by spaces.
[Options] This section specifies the options of the code table input method that you can turn on or off in the following entries.
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_TW/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_TW/common/
Add the code table to the input method specification file, /usr/lib/im/locale/zh_TW/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.