Imported upstream version 1.5
[manpages-zh.git] / raw / man1 / loadkeys.1
blobd188238804aa70d5e93aec2ed59aa8d1546ed9c8
1 .\" @(#)loadkeys.1
2 .TH LOADKEYS 1 "6 Feb 1994"
3 .SH NAME
4 loadkeys \- load keyboard translation tables
5 .SH SYNOPSIS
6 .B loadkeys
8 .I -c --clearcompose
9 ] [
10 .I -d --default
11 ] [
12 .I -h --help
13 ] [
14 .I -m --mktable
15 ] [
16 .I -s --clearstrings
17 ] [
18 .I -v --verbose
19 ] [
20 .I filename...
22 .LP
23 .SH DESCRIPTION
24 .IX "loadkeys command" "" "\fLloadkeys\fR command"  
25 .LP
26 The program
27 .B loadkeys
28 reads the file or files specified by
29 .IR filename... .
30 Its main purpose is to load the kernel keymap for the console.
31 .SH "RESET TO DEFAULT"
32 If the
33 .I -d
34 (or
35 .I --default
36 ) option is given,
37 .B loadkeys
38 loads a default keymap, probably the file
39 .I defkeymap.map
40 either in
41 .I //lib/kbd/keymaps
42 or in
43 .IR /usr/src/linux/drivers/char .
44 (Probably the former was user-defined, while the latter
45 is a qwerty keyboard map for PCs - maybe not what was desired.)
46 Sometimes, with a strange keymap loaded (with the minus on
47 some obscure unknown modifier combination) it is easier to
48 type `loadkeys defkeymap'.
49 .SH "LOAD KERNEL KEYMAP"
50 The main function of
51 .B loadkeys
52 is to load or modify the keyboard driver's translation tables.
53 When specifying the file names, standard input can be denoted
54 by dash (-). If no file is specified, the data is read from
55 the standard input.
56 .LP
57 For many countries and keyboard types appropriate keymaps
58 are available already, and a command like `loadkeys uk' might
59 do what you want. On the other hand, it is easy to construct
60 one's own keymap. The user has to tell what symbols belong
61 to each key. She can find the keycode for a key by use of
62 .BR showkey (1),
63 while the keymap format is given in
64 .BR keymaps (5)
65 and can also be seen from the output of
66 .BR dumpkeys (1).
67 .SH "LOAD KERNEL ACCENT TABLE"
68 If the input file does not contain any compose key definitions,
69 the kernel accent table is left unchanged, unless the
70 .I -c
71 (or
72 .I --clearcompose
73 ) option is given, in which case the kernel accent table is emptied.
74 If the input file does contain compose key definitions, then all
75 old definitions are removed, and replaced by the specified new entries.
76 The kernel accent table is a sequence of (by default 68) entries
77 describing how dead diacritical signs and compose keys behave.
78 For example, a line
79 .LP
80 .RS
81 compose ',' 'c' to ccedilla
82 .RE
83 .LP
84 means that <ComposeKey><,><c> must be combined to <ccedilla>.
85 The current content of this table can be see
86 using `dumpkeys --compose-only'.
87 .SH "LOAD KERNEL STRING TABLE"
88 The option
89 .I -s
90 (or
91 .I --clearstrings
92 ) clears the kernel string table. If this option is not given,
93 .B loadkeys
94 will only add or replace strings, not remove them.
95 (Thus, the option \-s is required to reach a well-defined state.)
96 The kernel string table is a sequence of strings
97 with names like F31. One can make function key F5 (on
98 an ordinary PC keyboard) produce the text `Hello!',
99 and Shift+F5 `Goodbye!' using lines
102 keycode 63 = F70 F71
104 string F70 = "Hello!"
106 string F71 = "Goodbye!"
109 in the keymap.
110 The default bindings for the function keys are certain
111 escape sequences mostly inspired by the VT100 terminal.
112 .SH "CREATE KERNEL SOURCE TABLE"
113 If the 
114 .I -m
116 .I --mktable
117 ) option is given
118 .B loadkeys
119 prints to the standard output a file that may be used as
120 .I /usr/src/linux\%/drivers\%/char\%/defkeymap.c,
121 specifying the default key bindings for a kernel
122 (and does not modify the current keymap).
123 .SH "OTHER OPTIONS"
125 .B \-h \-\-help
126 .B loadkeys
127 prints its version number and a short usage message to the programs
128 standard error output and exits.
129 .SH WARNING
130 Note that anyone having read access to
131 .B /dev/console
132 can run
133 .B loadkeys
134 and thus change the keyboard layout, possibly making it unusable. Note
135 that the keyboard translation table is common for all the virtual
136 consoles, so any changes to the keyboard bindings affect all the virtual
137 consoles simultaneously.
139 Note that because the changes affect all the virtual consoles, they also
140 outlive your session. This means that even at the login prompt the key
141 bindings may not be what the user expects.
142 .SH FILES
144 .BI //lib/kbd/keymaps
145 default directory for keymaps
148 .BI /usr/src/linux/drivers/char/defkeymap.map
149 default kernel keymap
150 .SH "SEE ALSO"
151 .BR dumpkeys (1),
152 .BR keymaps (5)