Important: The information in this document is obsolete and should not be used for new development.
KeyScript
TheKeyScript
procedure uses the supplied value to change the keyboard script, to change the keyboard layout or input method within the current keyboard script, or to make a setting related to text input. If the Keyboard menu is displayed,KeyScript
also updates the Keyboard menu.
PROCEDURE KeyScript (code: Integer);
code
- If 0 or positive, directly specifies a script system (that is, it is read as a script code). Negative values have special meanings.
DESCRIPTION
TheKeyscript
procedure makes the change based on the selector with which it is called. If more than one script system is enabled or if thesmfShowIcon
bit flag is set in the Script Manager variable accessed by theGetScriptManagerVariable
selectorsmGenFlags
,Keyscript
also updates the Keyboard menu by changing the icon displayed on the menu bar and placing a check beside the appropriate keyboard
menu item.The
code
parameter is a selector that can explicitly specify a keyboard script by script code. Script code constants are listed on page 6-52. If the selector specifies a script, then the current default keyboard layout ('KCHR'
resource) for that script, as specified in the script's international bundle resource, becomes the current keyboard layout.The selector can also implicitly specify a keyboard script (for example, the next script), a keyboard layout (for example, the previously used keyboard layout in the current script), or an input method (for example, inline input versus window-based input). It can also specify settings that enable or disable keyboard layouts and keyboard scripts, and toggle among input options or line direction. The valid constants for the
code
parameter are listed in Table 6-5 on page 6-18.If you call
KeyScript
and explicitly specify a script system that is not available,KeyScript
does nothing. The current keyboard script remains unchanged.SPECIAL CONSIDERATIONS
KeyScript
operates only on those keyboard-layout and key-remap resources that are present in the System file.Your application's keyboard-menu setting is not maintained by the Process Manager; if the state of the keyboard menu is changed while you are switched out, the Process Manager does not restore your setting when you are switched back in. However, the Process Manager does maintain the keyboard disable state (Script Manager variable
smKeyDisableState
) for your application. See "Selectors for Script Manager Variables" beginning on page 6-61 for a description of thesmKeyDisableState
variable.
KeyScript
may move memory; your application should not call this procedure at interrupt time.SEE ALSO
The Process Manager is described in Inside Macintosh: Processes.