UCKeyStateRecord
Determines dead-key state transitions in a 'uchr' resource.
Declaration
struct UCKeyStateRecordOverview
The Unicode keyboard-layout ('uchr') resource contains the data necessary to map virtual key codes to Unicode character codes for a given keyboard layout. The 'uchr' format consists of a header information section and five key mapping data sections. The UCKeyStateRecord type is used in the third key mapping section of the 'uchr' resource to determine dead-key state transitions. The UCKeyStateRecord structure permits complex dead-key state processing, such as a series of transitions from one dead-key state directly into another, in which each transition can emit a sequence of one or more Unicode characters.
Any modifier key combination which initiates a dead-key state or which is a valid terminator of a dead-key state refers to one of these records via the UCKeyOutput values in key-code-to-character tables. A UCKeyOutput value may index the offsets contained in a UCKeyStateRecordsIndex structure, which in turn refers to the actual dead-key state records.
Each UCKeyStateRecord structure maps from the current dead-key state to the character data to be output or the following dead-key state (if any), as follows:
If the current dead-key state is zero (that is, there are no dead keys in effect) the value in
stateZeroCharDatais output and the state is set to the value instateZeroNextState(this can be used to initiate a dead-key state).If the current dead-key state is non-zero and there is an entry for the state in
stateEntryData, then the corresponding value instateEntryData.charDatais output. The next state is then set to either akUCKeyStateEntryTerminalFormator akUCKeyStateEntryRangeFormatvalue; in either case, if the next dead-key state is 0, this implements a valid dead-key state terminator.If the current dead-key state is non-zero, and there is no entry for the state in
stateEntryData, the default state terminator is output from the'uchr'resource’s UCKeyStateTerminators table for the current state (or nothing may be output, if there is noUCKeyStateTerminatorstable or it has no entry for the current state). Then the value instateZeroCharDatais output, and the state is set to the value instateZeroNextState.