Table 34-1: Keymap Library Functions ________________________________________________________________________ | | | | askkeymapdefault() | ask for a pointer to current default keymap | |-----------------------|------------------------------------------------| | mapansi() | encode an ansi string into key codes | |-----------------------|------------------------------------------------| | maprawkey() | decode a raw key input event to an ansi string | |-----------------------|------------------------------------------------| | setkeymapdefault() | set the current default keymap for the system | |_______________________|________________________________________________| Table 34-2: Console Device Keymap Commands ________________________________________________________________________ | | | | cd_askkeymap | ask for the current console's keymap | |-----------------------|------------------------------------------------| | cd_setkeymap | set the current console's keymap | |-----------------------|------------------------------------------------| | cd_askdefaultkeymap* | set the current default keymap | |-----------------------|------------------------------------------------| | cd_setdefaultkeymap** | ask for a pointer to current default keymap | |-----------------------|------------------------------------------------| | * Obsolete - use askkeymapdefault() | | ** Obsolete - use setkeymapdefault() | |________________________________________________________________________| All of these commands deal with a set of pointers to key translation arrays, known as a keymap structure. the keymap structure is defined in <devices/keymap.h> and is shown below. struct KeyMap { UBYTE *km_LoKeyMapTypes; ULONG *km_LoKeyMap; UBYTE *km_LoCapsable; UBYTE *km_LoRepeatable; UBYTE *km_HiKeyMapTypes; ULONG *km_HiKeyMap; UBYTE *km_HiCapsable; UBYTE *km_HiRepeatable; }; The keymap structure contains pointers to arrays which define the ansi character or string that should be produced when a key or a combination of keys are pressed. For example, a keymap might specify that the key with raw value hex 20 should produce the ANSI character "a", and if the Shift key is being held it should produce the character "A". asking for the default keymap setting the default keymap accessing the keymap for the current console mapping key codes to ansi strings mapping ansi strings to key codes details of the keymap structure key map standards dead-class keys double-dead keys