Create and use your own input source on Mac
macOS comes with default input sources for languages, such as Pinyin for Chinese. You can create and add your own input source for any language. To do so, you need a rule file that maps what you type on the keyboard to the characters that are shown.
Create a custom input source
Open a text editing app that supports Unicode on your Mac.
Create your rule file using the sample file below as a guideline.
The file must be a plain text file.
Save the file with Unicode (UTF-16) encoding and an extension such as “.inputplugin”.
Double-click the saved file.
Your custom input source is added to the Input menu in the menu bar, and to the list of input sources in the Input Sources pane of Keyboard preferences. To see it, choose Apple menu > System Preferences, click Keyboard, then click Input Sources.
macOS also supports the .cin format. If you use a .cin file, the file encoding can be UTF-16 or UTF-8.
Sample rule file
# (c) Apple Inc. 2021
# Sample plug-in input source rule file.
# The # character is used to indicate comments.
# The file format must be plain text. The file encoding must be Unicode (UTF-16) with or without an initial BOM (Byte Order Mark).
# 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 plug-in.
# The only method currently supported is “TABLE”.
# ENCODE: This indicates whether the target is Traditional Chinese (“TC”), Simplified Chinese (“SC”) or Unicode (“Unicode”). All plug-in input sources appear as Unicode input sources in the Input Sources pane of Keyboard preferences.
# PROMPT: This is the name of the plug-in, shown in the Input Sources pane of Keyboard preferences and the Input menu.
# DELIMITER: This defines the delimiter for characters or phrases with the same input code.
# In this case, we are using the comma character.
# VERSION: This is used to indicate the version number of your plug-in.
# MAXINPUTCODE: The limit of the number of characters that can be input for a single conversion.
# There is no limit unless you specify one.
# VALIDINPUTKEY: The set of characters that can be used for input strings. These are case-insensitive but must be entered as one complete set.
# BEGINCHARACTER: This tag begins the definitions for the mappings and is required.
# The format for each mapping is:
# 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.
# ENDCHARACTER: This terminates the mapping definitions and is the last character in the file.
Delete a custom input source
On your Mac, choose Apple menu > System Preferences, click Keyboard, then click Input Sources.
Select your input source, then click the Remove button .
Keep the disabled plug-in file (you can add your input source again to the list of input sources), or move it to the Trash to delete it.