DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

mapkey(M)


mapkey, mapscrn, mapstr, convkey -- configure console keyboard, console screen, and console function key mapping

Syntax

mapkey [ -adoqx ] [ mapfile ]

mapkey [ -c csxmap ] [ mapfile ]

mapscrn [ -d ] [ mapfile ]

mapstr [ -d ] [ -f [ termtype ] ]

convkey [ old [ new ] ]

Description

mapkey, mapscrn and mapstr configure console keyboard mapping, console screen mapping, and the strings associated with console function keys respectively.

root can map or unmap any console device, while other users can map only the devices that they own.

mapkey, mapscrn and mapstr all understand the following option:


-d
Display an ASCII version on the standard output of the mapping table read from the kernel. The format of the output is suitable for input files to mapscrn, mapkey, or mapstr.
mapkey sets keyboard mapping for the console multiscreens, /dev/tty01 through /dev/tty12 if these are configured for use. If mapfile is not specified or the -a option is specified, mapkey uses the mapfiles defined for each multicreen in the file /etc/default/mapkey.

mapkey understands the following options:


-a
Set the keyboard mapping for the console multiscreens according to the entries in /etc/default/mapkey. Each line in this file names a multiscreen device and a corresponding mapfile in the /usr/lib/keyboard directory. For example, if you run mapkey -a with the following entry set in /etc/default/mapkey, the device /dev/tty01 is mapped using the file /usr/lib/keyboard/keys.fr:
tty01     keys.fr
If a file is not specified for a multiscreen device, mapkey uses the file /usr/lib/keyboard/keys.

-c csxmap
Convert mapfile to generate an xsconfig(X) keyboard configuration file csxmap for use by the Xsco(X) server. If mapfile is not specified, mapkey converts the file /usr/lib/keyboard/keys.

-o
Display the mapping table in octal notation.

-q
Suppress the display of error messages.

-x
Display the mapping table in hexadecimal notation.
mapscrn sets screen mapping for the console according to the file /usr/lib/console/screens if mapfile is not specified.

mapstr understands the following option:


-f [ termtype ]
Specify the terminal type for setting function key strings. mapstr reads the function key values from the file /usr/lib/keyboard/strings.d/termtype, and passes these values to tset(C). If termtype is not specified, mapstr takes the terminal type from the TERM environment variable. The default terminal type is ``ansi'' if TERM is not set.

If the -f option is not specified, mapstr reads the function key string entries in /usr/lib/keyboard/strings.

The mapstr utility expects 12 function keys. If your console keyboard uses a different number of function keys, these keys might have unexpected effects when you run your system console in scancode mode. For example, function keys above <F12> might behave like shifted function keys below <F12> (that is, <Shift><F1>, <Shift><F2>, and so on).

convkey translates an old-style mapkey file, old, into a file with the current format, new. If the new file is specified, the old file must also be specified. If old or new are not specified, convkey reads the standard input or writes to the standard output respectively.

Console keyboard mapping

The keyboard of the console operates independently from the screen. This is because of the way it generates the characters using scan-codes. The keys of the system console are mapped using mapkey, which applies only to the console and allows you to configure your console to use keyboards other than the standard US keyboard.

The function of mapkey is separate from that of mapchan in that the console keyboard should generate character codes in the form understood by the console display. This is most often the PC 8-bit code set (IBM 437), not the ISO 8859-1 8-bit code set.

mapkey files are supplied for various PC-AT and PS/2 style keyboards. The keyboard file that should be used is also influenced by the character set used by the console screen. All the keyboard files can be found in the /usr/lib/keyboard directory and are listed in ``Console mapkey files''. The mapkey files map the console keyboard to meet the given national standard. The mapkey file for a particular national standard may need to be modified for a specific keyboard. If you want to change the key map, link or copy the mapkey file appropriate for your keyboard to the file /usr/lib/keyboard/keys, so that it is accessed when mapkey is called with no arguments.

Console mapkey files

The following mapkey files in the directory /usr/lib/keyboard are supplied for PS/2 and PC-AT style keyboards and different character sets.

  ROM or vidi(C) font
PS/2 style PC PC PC PC PC PC
keyboard standard HP Nordic Portuguese Spanish Greek
  ibm 850 nor por spa grk
Belgian ps.ibm.bel ps.850.bel        
Canadian   ps.850.can        
Danish   ps.850.dan ps.nor.dan      
Dutch   ps.850.ndl        
Finnish   ps.850.fin        
French ps.ibm.fra ps.850.fra        
German ps.ibm.ger ps.850.ger        
Greek           ps.grk.gra
 (ASCII def.)            
Greek           ps.grk.grg
 (Greek def.)            
Italian ps.ibm.ita ps.850.ita        
Latin Spanish ps.ibm.lsp ps.850.lsp        
Norwegian   ps.850.nor ps.nor.nor      
Portuguese   ps.850.por   ps.por.por    
Spanish ps.at.spa*       ps.spa.spa  
Spanish Intl. ps.ibm.spa ps.850.spa        
Swedish ps.ibm.swe ps.850.swe        
Swiss French ps.ibm.swf ps.850.swf        
Swiss German ps.ibm.swg ps.850.swg        
UK English ps.ibm.ukd ps.850.ukd        
USA English ps.ibm.usa ps.850.usa        

 +---------------+-----------------------------------------------------------------------------+
 |               |                             ROM or vidi(C) font                             |
 +---------------+-----------------------------------------------------------------------------+
 |               +------------+------------+------------+------------+------------+------------+
 +---------------+------------+------------+------------+------------+------------+------------+
 |PS/2 style     | PC         | PC         | PC         | PC         | PC         | PC         |
 +---------------+------------+------------+------------+------------+------------+------------+
 |keyboard       | standard   | HP         | Nordic     | Portuguese | Spanish    | Greek      |
 +---------------+------------+------------+------------+------------+------------+------------+
 |               | ibm        | 850        | nor        | por        | spa        | grk        |
 +---------------+------------+------------+------------+------------+------------+------------+
 |Belgian        | ps.ibm.bel | ps.850.bel |            |            |            |            |
 +---------------+------------+------------+------------+------------+------------+------------+
 |Canadian       |            | ps.850.can |            |            |            |            |
 +---------------+------------+------------+------------+------------+------------+------------+
 |Danish         |            | ps.850.dan | ps.nor.dan |            |            |            |
 +---------------+------------+------------+------------+------------+------------+------------+
 |Dutch          |            | ps.850.ndl |            |            |            |            |
 +---------------+------------+------------+------------+------------+------------+------------+
 |Finnish        |            | ps.850.fin |            |            |            |            |
 +---------------+------------+------------+------------+------------+------------+------------+
 |French         | ps.ibm.fra | ps.850.fra |            |            |            |            |
 +---------------+------------+------------+------------+------------+------------+------------+
 |German         | ps.ibm.ger | ps.850.ger |            |            |            |            |
 +---------------+------------+------------+------------+------------+------------+------------+
 |Greek          |            |            |            |            |            | ps.grk.gra |
 +---------------+------------+------------+------------+------------+------------+------------+
 |  (ASCII def.) |            |            |            |            |            |            |
 +---------------+------------+------------+------------+------------+------------+------------+
 |Greek          |            |            |            |            |            | ps.grk.grg |
 +---------------+------------+------------+------------+------------+------------+------------+
 |  (Greek def.) |            |            |            |            |            |            |
 +---------------+------------+------------+------------+------------+------------+------------+
 |Italian        | ps.ibm.ita | ps.850.ita |            |            |            |            |
 +---------------+------------+------------+------------+------------+------------+------------+
 |Latin Spanish  | ps.ibm.lsp | ps.850.lsp |            |            |            |            |
 +---------------+------------+------------+------------+------------+------------+------------+
 |Norwegian      |            | ps.850.nor | ps.nor.nor |            |            |            |
 +---------------+------------+------------+------------+------------+------------+------------+
 |Portuguese     |            | ps.850.por |            | ps.por.por |            |            |
 +---------------+------------+------------+------------+------------+------------+------------+
 |Spanish        | ps.at.spa* |            |            |            | ps.spa.spa |            |
 +---------------+------------+------------+------------+------------+------------+------------+
 |Spanish Intl.  | ps.ibm.spa | ps.850.spa |            |            |            |            |
 +---------------+------------+------------+------------+------------+------------+------------+
 |Swedish        | ps.ibm.swe | ps.850.swe |            |            |            |            |
 +---------------+------------+------------+------------+------------+------------+------------+
 |Swiss French   | ps.ibm.swf | ps.850.swf |            |            |            |            |
 +---------------+------------+------------+------------+------------+------------+------------+
 |Swiss German   | ps.ibm.swg | ps.850.swg |            |            |            |            |
 +---------------+------------+------------+------------+------------+------------+------------+
 |UK English     | ps.ibm.ukd | ps.850.ukd |            |            |            |            |
 +---------------+------------+------------+------------+------------+------------+------------+
 |USA English    | ps.ibm.usa | ps.850.usa |            |            |            |            |
 +---------------+------------+------------+------------+------------+------------+------------+
* Press the <Alt> key to emulate PC-AT style keyboard.

  ROM or vidi(C) font
PC-AT style PC PC
keyboard standard ISO 8859/1
  ibm iso
French at.ibm.fra at.iso.fra
German at.ibm.ger at.iso.ger
Italian at.ibm.ita at.iso.ita
Norwegian   at.iso.nor
Spanish at.ibm.spa at.iso.spa
Swedish   at.iso.swe
Swiss French   at.iso.swf
Swiss German   at.iso.swg
UK English at.ibm.ukd at.iso.ukd
USA English at.ibm.usa at.iso.usa
Japanese keyboard AX 106
jpn.ax jpn.106
Siemens WX200 PC standard  
style keyboard ibm  
American wx.ibm.usa  
German wx.ibm.ger  
German (old) wx.ibm.ger.old  

 +------------------+-----------------------------+
 |                  |     ROM or vidi(C) font     |
 +------------------+-----------------------------+
 |                  +----------------+------------+
 +------------------+----------------+------------+
 |PC-AT style       | PC             | PC         |
 +------------------+----------------+------------+
 |keyboard          | standard       | ISO 8859/1 |
 +------------------+----------------+------------+
 |                  | ibm            | iso        |
 +------------------+----------------+------------+
 |French            | at.ibm.fra     | at.iso.fra |
 +------------------+----------------+------------+
 |German            | at.ibm.ger     | at.iso.ger |
 +------------------+----------------+------------+
 |Italian           | at.ibm.ita     | at.iso.ita |
 +------------------+----------------+------------+
 |Norwegian         |                | at.iso.nor |
 +------------------+----------------+------------+
 |Spanish           | at.ibm.spa     | at.iso.spa |
 +------------------+----------------+------------+
 |Swedish           |                | at.iso.swe |
 +------------------+----------------+------------+
 |Swiss French      |                | at.iso.swf |
 +------------------+----------------+------------+
 |Swiss German      |                | at.iso.swg |
 +------------------+----------------+------------+
 |UK English        | at.ibm.ukd     | at.iso.ukd |
 +------------------+----------------+------------+
 |USA English       | at.ibm.usa     | at.iso.usa |
 +------------------+----------------+------------+
 |Japanese keyboard | AX             | 106        |
 +------------------+----------------+------------+
 |                  | jpn.ax         | jpn.106    |
 +------------------+----------------+------------+
 |Siemens WX200     | PC standard    |            |
 +------------------+----------------+------------+
 |style keyboard    | ibm            |            |
 +------------------+----------------+------------+
 |American          | wx.ibm.usa     |            |
 +------------------+----------------+------------+
 |German            | wx.ibm.ger     |            |
 +------------------+----------------+------------+
 |German (old)      | wx.ibm.ger.old |            |
 +------------------+----------------+------------+
Note that the layout of different manufacturers' keyboards can vary, so some changes may be necessary to these files for correct operation on your system.

Limitations

There is no way to specify that the map utilities read their configuration tables from standard input.

If mapkey -a is run but the correct tty line cannot be found in /etc/default/mapkey, mapkey reads the default file /usr/lib/keyboard/keys. Likewise, if no key file is specified against the appropriate tty entry in /etc/default/mapkey, mapkey -a uses /usr/lib/keyboard/keys. When the user logs off, getty will reset any keyboard mappings on that line unless MAPKEY=YES is added to /etc/default/boot. When this change is made, getty also reads /etc/default/mapkey at login time, to obtain the mapkey file to use with each tty.

Files


/usr/lib/keyboard/*
keyboard maps

/usr/lib/console/*
screen font maps

See also

keyboard(HW), mapchan(M), scancode(HW), screen(HW), setkey(C), tset(C), Xsco(X), xsconfig(X)

Standards conformance

convkey, mapkey, mapscrn and mapstr are not part of any currently supported standard; they are extensions of AT&T System V provided by The Santa Cruz Operation, Inc.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003