You are on page 1of 4

BasicInputMethod

Version 1.0 April 20, 2001 BasicInputMethod is a simple input method, implemented as a text service component for Mac OS X. It demonstrates the principles of writing a text service component, including factoring text services into client/server components, sending and receiving text input Carbon events, and interprocess communication. For more information on input methods and text services, see the Text Services Manager documentation at <http://developer.apple.com/techpubs/macosx/Carbon/carbon.html>.

Quick Install
1) Copy BasicInputMethod.component to your /Library/Components/ components directory. For example, cp -r BasicInputMethod/build/BasicInputMethod.component /Library/Components/ 2) Log out and log in again. 3) Open System Preferences, select International and select the Keyboard Menu pane. 4) Click the check box next to Basic Input Method to enable the input method in the keyboard menu.

About BasicInputMethod
BasicInputMethod is a simple input method for Mac OS X. It is implemented in 2 parts(1) a text service component (BasicInputMethod.component) and (2) a server application (BasicServer.app). The server application is contained inside the text service component bundle so it is not directly visible from the Finder. BasicInputMethod accepts roman keyboard input in its conversion buffer. Pressing return fixes the text. Convert To Lowercase and Convert To Uppercase menu commands allow you to modify text in the inline hole. The server implements a keyboard palette and a send event palette. Clicking keys on the keyboard palette will send the corresponding text into the current inline hole. Show Keyboard Palette and Hide Keyboard Palette in the input methods text service (pencil) menu reveal or hide the keyboard palette. The send

event allows to you to send text input events to the client application and observe the results. Currently OffsetToPos is the only event supported. Communication between the text service component and the server uses the CFMessagePort API.

Building BasicInputMethod
BasicInputMethod is implemented as a Project Builder project (BasicInputMethod.pbproj). The project contains 2 targets, one for the text service component itself (BasicInputMethod.component) and one for the server application (BasicServer.app). You just need to build the BasicInputMethod target. The BasicServer target will be built automatically and the output copied into the SharedSupport directory of the BasicInputMethod text service component bundle.

Installing BasicInputMethod
Copy the text service component into /Library/Components. For example, cd BasicInputMethod/build cp -r BasicInputMethod.component /Library/Components/ After installing the input method for the first time, you must log out once for the Text Services Manager to see the new text services component.

Running BasicInputMethod
BasicInputMethod appears as "Basic Input Method" in the keyboard menu. Currently BasicInputMethod identifies itself as a Japanese input method so it will appear among other Japanese input methods, if any, in the keyboard menu. You can change the input method script to languages other than Japanese by changing the script, language, and base resource ID in BIMScript.h. To test text input features, run an application such as TextEdit and select BasicInputMethod from the keyboard menu. When BasicInputMethod is activated, the server process (BasicServer.app) is automatically launched if it is not already running.

BasicInputMethod.component
BIM.c BIMComponent.c

ources

Core functionality of the input method. Main entry point for our text service and the direct

interface to the Component Manager. Contains BIMComponentDispatch and the selector-based functions that are called by the Text Services Manager. Most functions call directly into corresponding functions in BIM.c. BIMInputEvents.c Functions to talk to the host application and the Text Services Manager using Carbon events (includes UpdateActiveInputArea). Functions to detect and launch the server. Functions to initialize a server CFMessagePort and handle incoming messages from the server. Functions to send messages to the server. Resources incorporated by the Basic Input Method, including the thng resource and icons.

BIMLaunchServer.c BIMMessageReceive.c

BIMMessageSend.c BIM.r

Basic er!er.app
BS.c BSDebugPalette.c

ources
Main entry point for the server. Not implemented. Functions to implement a debug palette are in-progress. Functions to implement the keyboard palette. Functions to initialize a server CFMessagePort, register and track our client text service components, and handle incoming messages. Functions to send messages to our client text service components. Functions to manage user preferences. Preferences are not currently saved on disk. Functions to manage the send event palette.

BSKeyboardPalette.c BSMessageReceive.c

BSMessageSend.c

BSPreferences.c

BSSendEventPalette.c

hared "eaders
BIMClientServer.h Constants and data structures shared between the

text service component and the server application. BIMScript.h The script and language this input method supports.

You might also like