Documentation Archive Developer
Search

ADC Home > Reference Library > Technical Q&As > Carbon > Interapplication Communication >

Installing input methods on Mac OS X


Q: I have written an input method for Mac OS X. How do I install and use it?

A: Here are the steps required to install and activate an input method on Mac OS X.

Installing your input method for the first time

  1. Copy your input method into the appropriate Components directory.

    The Text Services Manager will recognize text service components in the following Components directories. In most cases, you will install your input method in /Library/Components.

    DirectoryDomainInput Method Type and Availability
    /System/Library/ComponentsSystemSystem-provided components available to all users on the computer
    /Library/ComponentsLocalUser-installed components available to all users on the computer
    ~/Library/ComponentsUserUser-installed components available to the owner of the directory

    For example:

    mkdir -p /Library/Componentscp -r {MyInputMethod}.component /Library/Components/

    NOTE:
    Apple recommends that you package all files used by your input method into a single bundle of type .component so your input method will appear as a single entity in the Finder. Files or executables intended to be manipulated by the user should not be placed in the Components directory.

  2. Restart the computer.

    The Component Manager scans for components on startup so you must restart for your input method to be recognized.

  3. Open the System Preferences application.

  4. Select the International Panel.

  5. Select the Keyboard Menu Pane.

  6. Find your input method in the list and turn on its check box.

    As soon as you enable multiple keyboard layouts or input methods, the keyboard menu will appear as the right-most menu in all running applications. (The U.S. keyboard is always enabled so enabling any other keyboard layout or input method will cause the keyboard menu to appear.)

  7. Select your input method from the keyboard menu.

Installing subsequent development builds of your input method

The first time you install your input method, you must follow the steps described above. If you subsequently make modifications to your input method you can test it as described below without restarting the computer.

  1. Quit the application you are using to test your input method.

  2. Terminate server processes (if any) that belong to your input method.

  3. Replace your input method in the Components directory with the new version.

  4. Launch the application you are using to test your input method.

NOTE:
If you modify the input method's name, icon, or 'thng' resource you need to restart for the changes to take effect.

Writing an installer

When you deliver your input method to users, you should package it in an installer. At a minimum, the installer should perform the following steps:

  1. Create the /Library/Components directory if it does not exist.

  2. Copy the input method and associated files into /Library/Components.

  3. Restart the computer.

IMPORTANT:
Text service components are scanned on startup so you must require the user to restart the machine after installing the your input method.

For information on writing input methods see the Text Services Manager documentation and BasicInputMethod sample code.


[Sep 14 2001]