Important: The information in this document is obsolete and should not be used for new development.
TSMEvent
TheTSMEvent
function passes all events obtained from theWaitNextEvent
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 functionWaitNextEvent
. Some of these events may need to be handled by text service components. TheTSMEvent
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 theTextServiceEvent
function for each component (see page 7-87).If
TSMEvent
returnsFALSE
, you need to process the event as you normally do. IfTSMEvent
returnsTRUE
, 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 functionAESend
to pass data to your application through an Apple event. Your Apple event handler is thus invoked before theTSMEvent
trap has returned.SEE ALSO
TheWaitNextEvent
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.