[Contents] [Index] [Help] [Retrace] [Browse <] [Browse >]


                   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