~ubuntu-branches/ubuntu/karmic/x11-xserver-utils/karmic

« back to all changes in this revision

Viewing changes to xmodmap/xmodmap.man

  • Committer: Bazaar Package Importer
  • Author(s): Brice Goglin, Julien Cristau, Brice Goglin
  • Date: 2007-08-17 09:58:34 UTC
  • Revision ID: james.westby@ubuntu.com-20070817095834-ywge2nyzj1s3rqnd
Tags: 7.3+1
[ Julien Cristau ]
* iceauth 1.0.2.
  + removes blank line in the manpage (closes: #25285).
* xmodmap 1.0.3.
  + manpage updated to state that -pm is the default (closes: #236198)
* xgamma 1.0.2.
  + the manpage now explains how to print the gamma value more clearly
    (closes: #296021).
* xsetroot 1.0.2.
* xrdb 1.0.4.
  + fixes manpage typo (closes: #276286).
* Add upstream URL to debian/copyright, and update it from xgamma's COPYING
  file.

[ Brice Goglin ]
* Add menu entries for xrefresh and xvidtune.
* sessreg 1.0.3.
* xset 1.0.3.
* Add myself to Uploaders, and remove Branden with his permission.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.\" $Xorg: xmodmap.man,v 1.4 2001/02/09 02:05:56 xorgcvs Exp $
 
2
.\" Copyright 1988, 1989, 1990, 1998  The Open Group
 
3
.\" Copyright 1987 Sun Microsystems, Inc.
 
4
.\" 
 
5
.\" Permission to use, copy, modify, distribute, and sell this software and its
 
6
.\" documentation for any purpose is hereby granted without fee, provided that
 
7
.\" the above copyright notice appear in all copies and that both that
 
8
.\" copyright notice and this permission notice appear in supporting
 
9
.\" documentation.
 
10
.\" 
 
11
.\" The above copyright notice and this permission notice shall be included
 
12
.\" in all copies or substantial portions of the Software.
 
13
.\" 
 
14
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 
15
.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 
16
.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 
17
.\" IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
 
18
.\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 
19
.\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 
20
.\" OTHER DEALINGS IN THE SOFTWARE.
 
21
.\" 
 
22
.\" Except as contained in this notice, the name of The Open Group shall
 
23
.\" not be used in advertising or otherwise to promote the sale, use or
 
24
.\" other dealings in this Software without prior written authorization
 
25
.\" from The Open Group.
 
26
.\" 
 
27
.\" $XFree86: xc/programs/xmodmap/xmodmap.man,v 1.11 2002/10/12 16:06:48 herrb Exp $
 
28
.\" 
 
29
.de EX          \"Begin example
 
30
.ne 5
 
31
.if n .sp 1
 
32
.if t .sp .5
 
33
.nf
 
34
.in +.5i
 
35
..
 
36
.de EE
 
37
.fi
 
38
.in -.5i
 
39
.if n .sp 1
 
40
.if t .sp .5
 
41
..
 
42
.TH XMODMAP 1 __xorgversion__
 
43
.SH NAME
 
44
xmodmap - utility for modifying keymaps and pointer button mappings in X
 
45
.SH SYNOPSIS
 
46
.B xmodmap
 
47
[-options ...] [filename]
 
48
.SH DESCRIPTION
 
49
.PP
 
50
The \fIxmodmap\fP program is used to edit and display the 
 
51
keyboard \fImodifier map\fP and \fIkeymap table\fP that are used by client 
 
52
applications to convert event keycodes into keysyms.  It is usually run from 
 
53
the user's session startup script to configure the keyboard according to 
 
54
personal tastes.
 
55
.SH OPTIONS
 
56
.PP
 
57
The following options may be used with \fIxmodmap\fP:
 
58
.TP 8
 
59
.B \-display \fIdisplay\fP
 
60
This option specifies the host and display to use.
 
61
.TP 8
 
62
.B \-help
 
63
This option indicates that a brief description of the command line arguments
 
64
should be printed on the standard error channel.  This will be done whenever an
 
65
unhandled argument is given to
 
66
.I xmodmap.
 
67
.TP 8
 
68
.B \-grammar
 
69
This option indicates that a help message describing the expression grammar 
 
70
used in files and with \-e expressions should be printed on the standard error.
 
71
.TP 8
 
72
.B \-verbose
 
73
This option indicates that 
 
74
.I xmodmap
 
75
should print logging information as it parses its input.
 
76
.TP 8
 
77
.B \-quiet
 
78
This option turns off the verbose logging.  This is the default.
 
79
.TP 8
 
80
.B \-n
 
81
This option indicates that 
 
82
.I xmodmap
 
83
should not change the mappings, but should display what it would do, like
 
84
\fImake(1)\fP does when given this option.
 
85
.TP 8
 
86
.B \-e \fIexpression\fB
 
87
This option specifies an expression to be executed.  Any number of expressions
 
88
may be specified from the command line.
 
89
.TP 8
 
90
.B \-pm
 
91
This option indicates that the current modifier map should be printed on the
 
92
standard output.   This is the default mode of operation if no other mode
 
93
options are specified.
 
94
.TP 8
 
95
.B \-pk
 
96
This option indicates that the current keymap table should be printed on the
 
97
standard output.
 
98
.TP 8
 
99
.B \-pke
 
100
This option indicates that the current keymap table should be printed on the
 
101
standard output in the form of expressions that can be fed back to
 
102
\fIxmodmap\fP.
 
103
.TP 8
 
104
.B \-pp
 
105
This option indicates that the current pointer map should be printed on the
 
106
standard output.
 
107
.TP 8
 
108
.B \-
 
109
A lone dash means that the standard input should be used as the input file.
 
110
.PP
 
111
The \fIfilename\fP specifies a file containing \fIxmodmap\fP expressions
 
112
to be executed.  This file is usually kept in the user's home directory with
 
113
a name like \fI.xmodmaprc\fP.
 
114
.SH EXPRESSION GRAMMAR
 
115
.PP
 
116
The
 
117
.I xmodmap
 
118
program reads a list of expressions and parses them all before attempting
 
119
to execute any of them.  This makes it possible to refer to keysyms that are
 
120
being redefined in a natural way without having to worry as much about name
 
121
conflicts.
 
122
.TP 8
 
123
.B keycode \fINUMBER\fP = \fIKEYSYMNAME ...\fP
 
124
The list of keysyms is assigned to the indicated keycode 
 
125
(which may be specified in decimal, hex or octal and can be determined by 
 
126
running the
 
127
.I xev
 
128
program).  Up to eight keysyms may be attached to a key, however the last four
 
129
are not used in any major X server implementation.  The first keysym is used
 
130
when no modifier key is pressed in conjunction with this key, the second with
 
131
Shift, the third when the Mode_switch key is used with this key and the fourth
 
132
when both the Mode_switch and Shift keys are used.
 
133
.TP 8
 
134
.B keycode any = \fIKEYSYMNAME ...\fP
 
135
If no existing key has the specified list of keysyms assigned to it,
 
136
a spare key on the keyboard is selected and the keysyms are assigned to it.
 
137
The list of keysyms may be specified in decimal, hex or octal.
 
138
.TP 8
 
139
.B keysym \fIKEYSYMNAME\fP = \fIKEYSYMNAME ...\fP
 
140
The \fIKEYSYMNAME\fP on the left hand side is translated into matching keycodes
 
141
used to perform the corresponding set of \fBkeycode\fP expressions.
 
142
The list of keysym names may be
 
143
found in the header file \fI<X11/keysymdef.h>\fP (without the \fIXK_\fP prefix)
 
144
or the keysym database \fI __projectroot__/lib/X11/XKeysymDB\fP.  Note that
 
145
if the same keysym is bound to multiple keys, the expression is executed
 
146
for each matching keycode.
 
147
.TP 8
 
148
.B clear \fIMODIFIERNAME\fP
 
149
This removes all entries in the modifier map for the given modifier, where 
 
150
valid name are:
 
151
.BR Shift ,
 
152
.BR Lock ,
 
153
.BR Control ,
 
154
.BR Mod1 ,
 
155
.BR Mod2 ,
 
156
.BR Mod3 ,
 
157
.BR Mod4 ,
 
158
and \fBMod5\fP (case 
 
159
does not matter in modifier names, although it does matter for all other
 
160
names).  For example, ``clear Lock'' will remove
 
161
all any keys that were bound to the shift lock modifier.
 
162
.TP 8
 
163
.B add \fIMODIFIERNAME\fP = \fIKEYSYMNAME ...\fP
 
164
This adds all keys containing the given keysyms to the indicated modifier map.
 
165
The keysym names
 
166
are evaluated after all input expressions are read to make it easy to write
 
167
expressions to swap keys (see the EXAMPLES section).
 
168
.TP 8
 
169
.B remove \fIMODIFIERNAME\fP = \fIKEYSYMNAME ...\fP
 
170
This removes all keys containing the given keysyms from the indicated
 
171
modifier map.  Unlike
 
172
.B add,
 
173
the keysym names are evaluated as the line is read in.  This allows you to
 
174
remove keys from a modifier without having to worry about whether or not they
 
175
have been reassigned.
 
176
.TP 8
 
177
.B "pointer = default"
 
178
This sets the pointer map back to its default settings (button 1 generates a 
 
179
code of 1, button 2 generates a 2, etc.).
 
180
.TP 8
 
181
.B pointer = \fINUMBER ...\fP
 
182
This sets the pointer map to contain the indicated button codes.  The list
 
183
always starts with the first physical button.
 
184
.PP
 
185
Lines that begin with an exclamation point (!) are taken as comments.
 
186
.PP
 
187
If you want to change the binding of a modifier key, you must also remove it
 
188
from the appropriate modifier map.
 
189
.SH EXAMPLES
 
190
.PP
 
191
Many pointers are designed such that the first button is pressed using the
 
192
index finger of the right hand.  People who are left-handed frequently find
 
193
that it is more comfortable to reverse the button codes that get generated
 
194
so that the primary button is pressed using the index finger of the left hand.
 
195
This could be done on a 3 button pointer as follows:
 
196
.EX
 
197
%  xmodmap -e "pointer = 3 2 1"
 
198
.EE
 
199
.PP
 
200
Many applications support the notion of Meta keys (similar to Control 
 
201
keys except that Meta is held down instead of Control).  However,
 
202
some servers do not have a Meta keysym in the default keymap table, so one
 
203
needs to be added by hand.
 
204
The following command will attach Meta to the Multi-language key (sometimes
 
205
labeled Compose Character).  It also takes advantage of the fact that 
 
206
applications that need a Meta key simply need to get the keycode and don't
 
207
require the keysym to be in the first column of the keymap table.  This
 
208
means that applications that are looking for a Multi_key (including the
 
209
default modifier map) won't notice any change.
 
210
.EX
 
211
%  xmodmap -e "keysym Multi_key = Multi_key Meta_L"
 
212
.EE
 
213
.PP
 
214
Similarly, some keyboards have an Alt key but no Meta key.
 
215
In that case the following may be useful:
 
216
.EX
 
217
%  xmodmap -e "keysym Alt_L = Meta_L Alt_L"
 
218
.EE
 
219
.PP
 
220
One of the more simple, yet convenient, uses of \fIxmodmap\fP is to set the
 
221
keyboard's "rubout" key to generate an alternate keysym.  This frequently
 
222
involves exchanging Backspace with Delete to be more comfortable to the user.
 
223
If the \fIttyModes\fP resource in \fIxterm\fP is set as well, all terminal 
 
224
emulator windows will use the same key for erasing characters:
 
225
.EX
 
226
%  xmodmap -e "keysym BackSpace = Delete"
 
227
%  echo "XTerm*ttyModes:  erase ^?" | xrdb -merge
 
228
.EE
 
229
.PP
 
230
Some keyboards do not automatically generate less than and greater than
 
231
characters when the comma and period keys are shifted.  This can be remedied
 
232
with \fIxmodmap\fP by resetting the bindings for the comma and period with
 
233
the following scripts:
 
234
.EX
 
235
!
 
236
! make shift-, be < and shift-. be >
 
237
!
 
238
keysym comma = comma less
 
239
keysym period = period greater
 
240
.EE
 
241
.PP
 
242
One of the more irritating differences between keyboards is the location of the
 
243
Control and Shift Lock keys.  A common use of \fIxmodmap\fP is to swap these
 
244
two keys as follows:
 
245
.EX
 
246
!
 
247
! Swap Caps_Lock and Control_L
 
248
!
 
249
remove Lock = Caps_Lock
 
250
remove Control = Control_L
 
251
keysym Control_L = Caps_Lock
 
252
keysym Caps_Lock = Control_L
 
253
add Lock = Caps_Lock
 
254
add Control = Control_L
 
255
.EE
 
256
.PP
 
257
This example can be run again to swap the keys back to their previous 
 
258
assignments.
 
259
.PP
 
260
The \fIkeycode\fP command is useful for assigning the same keysym to
 
261
multiple keycodes.  Although unportable, it also makes it possible to write
 
262
scripts that can reset the keyboard to a known state.  The following script
 
263
sets the backspace key to generate Delete (as shown above), flushes all 
 
264
existing caps lock bindings, makes the CapsLock
 
265
key be a control key, make F5 generate Escape, and makes Break/Reset be a
 
266
shift lock.
 
267
.EX
 
268
!
 
269
! On the HP, the following keycodes have key caps as listed:
 
270
!
 
271
!     101  Backspace
 
272
!      55  Caps
 
273
!      14  Ctrl
 
274
!      15  Break/Reset
 
275
!      86  Stop
 
276
!      89  F5
 
277
!
 
278
keycode 101 = Delete
 
279
keycode 55 = Control_R
 
280
clear Lock
 
281
add Control = Control_R
 
282
keycode 89 = Escape
 
283
keycode 15 = Caps_Lock
 
284
add Lock = Caps_Lock
 
285
.EE
 
286
.SH ENVIRONMENT
 
287
.PP
 
288
.TP 8
 
289
.B DISPLAY
 
290
to get default host and display number.
 
291
.SH SEE ALSO
 
292
X(__miscmansuffix__), xev(1), \fIXlib\fP documentation on key and pointer events
 
293
.SH BUGS
 
294
.PP
 
295
Every time a \fBkeycode\fP expression is evaluated, the server generates
 
296
a \fIMappingNotify\fP event on every client.  This can cause some thrashing.
 
297
All of the changes should be batched together and done at once.
 
298
Clients that receive keyboard input and ignore \fIMappingNotify\fP events
 
299
will not notice any changes made to keyboard mappings.
 
300
.PP
 
301
.I Xmodmap
 
302
should generate "add" and "remove" expressions automatically
 
303
whenever a keycode that is already bound to a modifier is changed.
 
304
.PP
 
305
There should be a way to have the
 
306
.I remove
 
307
expression accept keycodes as well as keysyms for those times when you really
 
308
mess up your mappings.
 
309
.SH AUTHOR
 
310
Jim Fulton, MIT X Consortium, rewritten from an earlier version by
 
311
David Rosenthal of Sun Microsystems.
 
312