Key Caps and the 'KCAP' resource
Key Caps and the 'KCAP' resource
This section discusses some enhancements to the Key Caps desk accessory and describes its related resource, 'KCAP', which specifies the physical layout
of keyboards. With System 7.0, Key Caps supplies additional feedback on using dead keys to produce accented characters. The 'KCAP' resource is used by
Note: The Keyboard Layout file formerly associated with Key Caps no longer exists. The 'KCAP' resources that were formerly located in
this file now reside in the System file.
Dead-Key Feedback
The Key Caps desk accessory provides feedback on using dead keys to produce accented characters. It indicates dead keys with dotted b orders, as shown in the
Key Caps window in the figure below, which shows the U.S. keyboard layout with the Option key pressed.
Key Caps display of dead keys with Option key pressed If a dead key is entered, such as the circumflex dead-key combination
(Option-I), the display changes to highlight the completer keys for this dead
key that users can press to generate valid accented character combinations, as
shown in the Key Caps window in the figure below. If your application displays keyboards, you should use a similar method of indicating dead keys and
completers.
Key Caps display of completer keys after circumflex dead key has been pressed
The 'KCAP' Resource
The 'KCAP' resource specifies the physical layout of keyboards and is used by
the Key Caps desk accessory. Prior to system software version 7.0, 'KCAP' was located in the Key Layout file. With version 7.0, it is located in the System
file.
The code example below shows the Rez format for the 'KCAP' resource.
type 'KCAP' {
rect; //boundsRect
rect; //textRect
integer = $$CountOf(MainArray);
array MainArray {
integer = $$CountOf(ShapeArray) - 1;
wide array ShapeArray {
point; //shapePoint
};
integer = $$CountOf(KeyArray) - 1;
wide array KeyArray {
byte; //mask
boolean or, and;
bit string[7]; //keyCode
integer; //dv
integer; //dh
};
};
};