Mac OS X 10.5 Help

System Prefs Icon

Creating and using your own input method

Mac OS X comes with some standard input methods for languages such as Chinese. You can add your own custom input method for any language.

To do this, you must first create a “rule file,” a text file that maps what you type on the keyboard and characters that are shown. You can save the file with either the Apple format “.inputplugin” or the “.cin” format, commonly used by other open source systems.

A sample input method rule file is at the end of this page.

To create a rule file for your own input method:

Step 1

Open TextEdit or another text editor.

Step 2

Create your own rule file using the sample text below as a guideline.

Step 3

Save the file with a name for your input method and the extension “.inputplugin” or “.cin”.

Step 4

Drag the file to the Input Methods folder in the top-level Library folder or the Input Methods folder in your home Library folder.

Step 5

Open System Preferences, click International, and then click Input Menu. Select the On check box beside your input method.

Step 6

Log out and then log in again.

Your custom input method appears in the Input menu.

If you don’t want to use a custom input method any more, delete the rule file you created from the Library folder in which it was placed.

Below is a sample format you can use:

# 
# (c) Apple Inc. 2007
# Sample plug-in input method rule file.
# The # character is used to indicate comments.
# The file format can be plain text or .cin. If plain text, the file encoding must be Unicode (UTF-16) with or without an initial BOM (Byte Order Mark). For .cin, the file encoding can be UTF-16 or UTF-8.
# The file consists of a number of tags, in uppercase ending with a colon, followed by the content of the tag.
#
# METHOD: This is the first entry in the file, defining the method used to implement the plugin.
# The only method currently supported is "TABLE".
#
METHOD: TABLE
#
# ENCODE: This indicates whether the target is Traditional Chinese ("TC"), Simplified Chinese ("SC"), or Unicode ("Unicode"). All plug-in input methods appear as Unicode input methods in the Input Menu pane of System Preferences > International.
#
ENCODE: TC
#
# PROMPT: This is the name of the plugin, shown in the Input Menu pane of System Preferences > International and the Input Menu.
#
PROMPT: SampleIM
#
# DELIMITER: This defines the delimiter for characters or phrases with same input code.
# In this case, we are using the comma character.
#
DELIMITER: ,
#
# VERSION: This is used to indicate the version number of the plug-in.
#
VERSION: 1.0
#
# MAXINPUTCODE: The limit of the number of characters that can be input for a single conversion.
# There is no limit unless you specify one.
#
MAXINPUTCODE: 8
#
# VALIDINPUTKEY: The set of characters that can be used for input strings. These are case-insensitive but must be entered as one complete set.
#
VALIDINPUTKEY: 0123456789-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
#
# BEGINCHARACTER: This tag begins the definitions for the mappings and is required.
# The format for each mapping is:
# [input string] [TAB] [output string1] [DELIMITER] [output string2] ... [DELIMITER] [output stringN]
# Blank lines and characters are ignored.
# The delimiter between output strings is that defined above by the DELIMITER tag.
# Indicate that the mapping definitions have ended with the
ENDCHARACTER tag.
#
BEGINCHARACTER
aardvark
土豚
abacus
算盤
abalone
鮑魚,鰒魚
apple
蘋果
#
# ENDCHARACTER: This terminates the mapping definitions and is the last character in the file.
#
ENDCHARACTER
Keywords: khelp kmosx kmosx5