Important: The information in this document is obsolete and should not be used for new development.
Using the Keyboard Resources
The Operating System, along with the Script Manager and other Macintosh system software managers, uses information in the keyboard resources to convert keystrokes into character codes; to display keyboard icons; to change the current keyboard script, keyboard layout, or input method when the user enters Command-key combinations; and to properly display keyboard layout with the Key Caps desk accessory.Most applications do not handle any of these tasks and therefore have no need for direct access to any of the keyboard resources. However, if you have the following special software needs related to text input, you can use the keyboard resources to help meet them:
- If your application needs to provide better international support for Command-key equivalents or a custom keyboard-layout resource, you can use the Event Manager
KeyTranslate
function to get the information you need from the appropriate keyboard-layout resource. See "Special Uses for the KeyTranslate Function" beginning on page C-22.- If you are creating your own localized version of a script system and need to allow text input in that script system, you may need to create or modify a keyboard-layout resource, and possible a key-remap resource. If you do make a new keyboard-layout resource, you also need to create a keyboard icon family to accompany it. To do that you will need the information in "Keyboard-Layout Resource (Type 'KCHR')" beginning on page C-18, "Key-Remap Resource (Type 'itlk')" beginning on page C-16, and "Keyboard Icon Family (Types 'kcs#', 'kcs4', 'kcs8')" beginning on page C-25.
- If you are designing a new type of keyboard, you need to make sure it produces the appropriate raw key codes. See the next section. Each new keyboard also needs to work correctly with the Key Caps desk accessory; see "Key-Caps Resource (Type 'KCAP')" beginning on page C-28. Note that hardware development is beyond the scope of Inside Macintosh. See Guide to the Macintosh Family Hardware and contact Macintosh Developer Technical Support for more information.