Important: The information in this document is obsolete and should not be used for new development.
TSMEvent
TheTSMEventfunction passes all events obtained from theWaitNextEventfunction, 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 functionWaitNextEvent. Some of these events may need to be handled by text service components. TheTSMEventfunction 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 theTextServiceEventfunction for each component (see page 7-87).If
TSMEventreturnsFALSE, you need to process the event as you normally do. IfTSMEventreturnsTRUE, 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 functionAESendto pass data to your application through an Apple event. Your Apple event handler is thus invoked before theTSMEventtrap has returned.![]()
SEE ALSO
TheWaitNextEventfunction is described in the Event Manager chapter of
Inside Macintosh: Macintosh Toolbox Essentials.For sample code that uses the
TSMEventfunction, see Listing 7-4 on page 7-22.