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
On your Mac, open a text editing app that supports Unicode.
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 a filename 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 Keyboard settings. To see it, choose Apple menu > System Settings, then click Keyboard in the sidebar. (You may need to scroll down.) Go to Text Input, then click Edit.
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. 2024
# Sample plugin 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 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 sources appear as Unicode input sources in Keyboard settings.
#
ENCODE: TC
#
# PROMPT: These options are available for some primary languages (for example, Italian).
#
PROMPT: Sample_En
#
# DELIMITER: This defines the delimiter for characters or phrases with the same input code.
# In this case, we are using the comma character.
#
DELIMITER: ,
#
# VERSION: This is used to indicate the version number of your plugin.
#
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:
# ...
# 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
Delete a custom input source
On your Mac, choose Apple menu > System Settings, then click Keyboard in the sidebar. (You may need to scroll down.)
Go to Text Input, then click Edit.
Select your input source, then click .
Keep the disabled plug-in file (you can add your input source again to the list of input sources), or move it to the Bin to delete it.