DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Customizing device character mapping

Keyboard maps

Each key on the console keyboard has a unique scan code. The keyboard map defines the scan code to character code mapping used by the operating system.


NOTE: These keyboard maps are only applicable to the keyboard used with an integrated console.

``Part of a keyboard map file'' shows one line from a keyboard map.

   50  'm'   'M'   cr    cr    escn  escn  nop   nop   N

Part of a keyboard map file

The first field is the scan code of the key. The next eight fields specify what value will be returned by the key when in different states. These states are:

The last field is used to indicate how the key is affected by the shift and num lock keys. This can be one of four letters:


O
unaffected by lock keys

C
affected by CAPS LOCK key

N
affected by NUM LOCK key

B
affected by both CAPS LOCK and NUM LOCK keys
Characters returned by a key can be specified by placing the appropriate character between single quotes (for example, the 'm' in ``Shell script to reconfigure a STREAM''). Single quotes and backslash are escaped by placing a backslash (\) in front of them. There are also special keywords that can be used to give keys special meanings. For example, in the above example, cr is used to indicate that the key returns a carriage return, and nop is used to indicate that the key does not return a code. In order to create a keyboard map, all scan codes from 0 to 127 must be specified. Any keys that are not specified will result in no character being sent from that key in any state. Examples of keyboard maps can be found in the directory /usr/lib/keyboard. For further information and details of which keys have which scan codes, see keyboard(7).


NOTE: When mapkey is used, the keyboard will only be remapped for the current virtual terminal. In order to keep the keyboard mapping when changing the virtual terminal, a file called .vtlrc must be created in the user's home directory. This file should contain the appropriate mapkey command.


Next topic: Dead/Compose key maps
Previous topic: Building code set, keyboard, and font maps

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 22 April 2004