Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Previous Book Contents Book Index Next

Inside Macintosh: Text /
Appendix C - Keyboard Resources

About Keyboards

The Macintosh computer supports over 12 separate physical types of keyboards. Your application needs to be able to handle text input from the domestic and ISO layouts of all Apple keyboards. It also needs to be able to distinguish multiple keyboards and to use the modifier flag that detects the state of the modifier keys (Shift, Caps Lock, Command, Option, and Control) on keyboards.

Table C-1 lists the keyboard types. These type values are used in some of the keyboard resources discussed later in this appendix.
Table C-1 The keyboard types
1Apple Keyboard and Apple Keyboard II (domestic layout)
2Apple Extended Keyboard and Apple Extended Keyboard II
(domestic layout)
3Small Macintosh 512K Keyboard (no keypad; domestic layout)
4Apple Keyboard (ISO layout)
5Apple Extended Keyboard II (ISO layout)
6Apple Macintosh Portable Keyboard (domestic layout)
7Apple Macintosh Portable Keyboard (ISO layout)
8Apple Macintosh Keyboard II (domestic layout)
9Apple Macintosh Keyboard II (ISO layout)
11Macintosh Plus Keyboard with the built-in keypad
12Macintosh PowerBook Keyboard (domestic layout)
13Macintosh PowerBook Keyboard (ISO layout)
259Small Macintosh 512K Keyboard (no keypad; ISO layout)

Figure C-1 and Figure C-2 show the U.S. layout of the Apple Keyboard II and Apple Extended Keyboard II and the virtual key codes produced by each key. The codes are the values that result after the raw key codes produced by the hardware have been mapped through the key-map resource. See "Key Translation" on page C-8. Other keyboards can produce different virtual key codes; some produce raw key codes only.

The Apple Extended Keyboard may be connected to the Apple Desktop Bus (ADB) of any computer in the Macintosh II or Macintosh SE family. It contains duplicated Shift, Option, and Control keys to the right of the Space bar. Other keyboards have different physical layouts.

Figure C-1 Apple Keyboard II (domestic layout)

Figure C-2 Apple Extended Keyboard II (domestic layout)

Table C-2 shows the keyboard modifier bits in the high byte of the modifiers field of an event record (defined by the EventRecord data type). The byte consisting of these bits is used to control the selection of tables in the keyboard-layout resource. See "Keyboard-Layout Resource (Type 'KCHR')" beginning on page C-18.
Table C-2 The keyboard modifier bits in an event record
7(Right Control if used)[14]
6(Right Option if used) [14]
5(Right Shift if used) [14]
4Control (Left Control if different from Right Control)
3Option (Left Option if different from Right Option)
2Caps Lock
1Shift (Left Shift if different from Right Shift)

[14] See "Reassigning Right-Hand Key Codes" beginning on page C-14.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996

Get information on Apple products.
Visit the Apple Store online or at retail locations.

Copyright © 2004 Apple Computer, Inc.
All rights reserved. | Terms of use | Privacy Notice