Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Text /
Chapter 7 - Text Services Manager / Text Services Manager Reference
Text Services Manager Routines for Client Applications / Passing Events to Text Service Components


TSMEvent

The TSMEvent function passes all events obtained from the WaitNextEvent function, including null events, to the Text Services Manager.

FUNCTION TSMEvent (VAR event: EventRecord): Boolean;
event
The event record for the event that has been obtained from WaitNextEvent.
DESCRIPTION
Your client application regularly obtains events such as key-down events from the Toolbox Event Manager function WaitNextEvent. Some of these events may need to be handled by text service components. The TSMEvent function lets you pass those events to the Text Services Manager. The Text Services Manager dispatches the passed events to the appropriate text service components by calling the TextServiceEvent function for each component (see page 7-87).

If TSMEvent returns FALSE, you need to process the event as you normally do. If TSMEvent returns TRUE, the event has been handled by a text service component and is now a null event. You should process the null event as you normally do.

Note
The way the Text Services Manager uses and dispatches Apple events creates the potential for a reentrance situation that your client application should know about and be prepared to handle. When your application calls TSMEvent, the Text Services Manager uses the Apple Event Manager function AESend to pass data to your application through an Apple event. Your Apple event handler is thus invoked before the TSMEvent trap has returned.
SEE ALSO
The WaitNextEvent function is described in the Event Manager chapter of
Inside Macintosh: Macintosh Toolbox Essentials.

For sample code that uses the TSMEvent function, see Listing 7-4 on page 7-22.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996