.\" $Xorg: xmodmap.man,v 1.3 2000/08/17 19:54:55 cpqbld Exp $ .\" Copyright 1988, 1989, 1990, 1998 The Open Group .\" Copyright 1987 Sun Microsystems, Inc. .\" .\" All Rights Reserved. .\" .\" The above copyright notice and this permission notice shall be included .\" in all copies or substantial portions of the Software. .\" .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. .\" IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR .\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, .\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR .\" OTHER DEALINGS IN THE SOFTWARE. .\" .\" Except as contained in this notice, the name of The Open Group shall .\" not be used in advertising or otherwise to promote the sale, use or .\" other dealings in this Software without prior written authorization .\" from The Open Group. .\" .\" Copyright (c) 1998, 1999, 2001 The X Japanese Documentation Project. .\" .\" Permission is hereby granted, free of charge, to any person obtaining a .\" copy of this software and associated documentation files (the .\" "Software"), to deal in the Software without restriction, including .\" without limitation the rights to use, copy, modify, merge, publish, dis- .\" tribute, sublicense, and/or sell copies of the Software, and to permit .\" persons to whom the Software is furnished to do so, subject to the fol- .\" lowing conditions: .\" .\" The above copyright notice and this permission notice shall be included .\" in all copies or substantial portions of the Software. .\" .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- .\" ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT .\" SHALL THE X JAPANESE DOCUMENTATION PROJECT BE LIABLE FOR ANY CLAIM, .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. .\" .\" Except as contained in this notice, the name of The X Japanese .\" Documentation Project shall not be used in advertising or otherwise to .\" promote the sale, use or other dealings in this Software without prior .\" written authorization from The X Japanese Documentation Project. .\" .\" X Window System is a trademark of The Open Group. .\" .\" Translated Mon Dec. 21, 1998 .\" by Shigeru tada .\" Corrected Mon Apr. 19, 1999 .\" by Shigeru tada , .\" 金田浩司 .\" Updated Sun Oct 21 14:45:57 JST 2001 for XFree86 4.1.0 .\" by FUJIWARA Teruyoshi .\" .\" $XFree86: xc/programs/xmodmap/xmodmap.man,v 1.9 2001/01/27 18:21:21 dawes Exp $ .\" .de EX \"Begin example .ne 5 .if n .sp 1 .if t .sp .5 .nf .in +.5i .. .de EE .fi .in -.5i .if n .sp 1 .if t .sp .5 .. .TH XMODMAP 1 "Release 6.5" "X Version 11" .SH 名前 .\"0 xmodmap - utility for modifying keymaps and pointer button mappings in X xmodmap - X上でキーマップや、ポインタボタンの割り当てを変更するユーティリティ .SH 書式 .B xmodmap [-options ...] [filename] .SH 説明 .PP .\"0 The \fIxmodmap\fP program is used to edit and display the .\"0 keyboard \fImodifier map\fP and \fIkeymap table\fP that are used by client .\"0 applications to convert event keycodes into keysyms. It is usually run from .\"0 the user's session startup script to configure the keyboard according to .\"0 personal tastes. .I xmodmap はクライアントのアプリケーション上で、イベントのキーコードをキー シムへ変換する時に使われるキーボード .I modifier マップと .I keymap テーブルを、表示したり編集する時に使われる。通常これはユーザセッション の起動スクリプトから、キーボードをユーザが自分の好みのキー配列にする時 に実行される。 .SH オプション .PP .\"0 The following options may be used with \fIxmodmap\fP: 以下のオプションが xmodmap では使われる。 .TP 8 .B \-display \fIdisplay\fP .\"0 This option specifies the host and display to use. 使用するホスト名とディスプレイを指定する。 .TP 8 .B \-help .\"0 This option indicates that a brief description of the command line arguments .\"0 should be printed on the standard error channel. This will be done whenever an .\"0 unhandled argument is given to .\"0 .I xmodmap. 標準エラー出力にコマンド行の簡潔な説明を表示する。 .I xmodmap が処理できない文字列が渡された場合には常時実行される。 .TP 8 .B \-grammar .\"0 This option indicates that a help message describing the expression grammar .\"0 used in files and with \-e expressions should be printed on the standard error. このオプションはファイルの中、および \-e expressions で用いられる表現 の文法のヘルプメッセージを標準エラー出力に表示する. .TP 8 .B \-verbose .\"0 This option indicates that .\"0 .I xmodmap .\"0 should print logging information as it parses its input. このオプションは .I xmodmap が入力を解析する際のログ情報を出力する。 .TP 8 .B \-quiet .\"0 This option turns off the verbose logging. This is the default. 冗長なログの出力をしない(デフォルト) .TP 8 .B \-n .\"0 This option indicates that .\"0 .I xmodmap .\"0 should not change the mappings, but should display what it would do, like .\"0 \fImake(1)\fP does when given this option. このオプションを指定すると .I xmodmap は実際にはキーのマッピングを変更しないが、 .I make(1) の \-n オプションのようにどのように変更されるのかを表示する。 .TP 8 .B \-e \fIexpression\fB .\"0 This option specifies an expression to be executed. Any number of expressions .\"0 may be specified from the command line. このオプションは実行される表現を指定する。コマンド行から任意の数の 表現を指定する事が出来る。 .TP 8 .B \-pm .\"0 This option indicates that the current modifier map should be printed on the .\"0 standard output. このオプションは現在の modifier マップの状態を標準出力に表示する。 .TP 8 .B \-pk .\"0 This option indicates that the current keymap table should be printed on the .\"0 standard output. このオプションは現在のキーマップテーブルを標準出力に表示する。 .TP 8 .B \-pke .\"0 This option indicates that the current keymap table should be printed on the .\"0 standard output in the form of expressions that can be fed back to .\"0 \fIxmodmap\fP. このオプションは現在のキーマップテーブルを .I xmodmap にフィードバック出来る形式で標準出力に表示する。 .TP 8 .B \-pp .\"0 This option indicates that the current pointer map should be printed on the .\"0 standard output. このオプションは現在のポインタボタンのマップの割り当て状況を表示する。 .TP 8 .B \- .\"0 A lone dash means that the standard input should be used as the input file. ダッシュ(-)だけを指定すると入力ファイルに標準入力が使用される。 .PP .\"0 The \fIfilename\fP specifies a file containing \fIxmodmap\fP expressions .\"0 to be executed. This file is usually kept in the user's home directory with .\"0 a name like \fI.xmodmaprc\fP. .I filename は実行される .I xmodmap の表現が記述されたファイルを指定する。このファイルは通常はユーザのホー ムディレクトリに .I .xmodmaprc の名前で保存される。 .\"0 .SH EXPRESSION GRAMMER .SH 表現文法 .PP .\"0 The .\"0 .I xmodmap .\"0 program reads a list of expressions and parses them all before attempting .\"0 to execute any of them. This makes it possible to refer to keysyms that are .\"0 being redefined in a natural way without having to worry as much about name .\"0 conflicts. .I xmodmap プログラムは表現のリストを実行する前にそれらの表現を一旦全て読み込んで 解析を行う。このことにより普通の方法では再定義されてしまうキーシム名を、 名前の衝突についてはそれほど気にかけることなく参照することが可能である。 .TP 8 .B keycode \fINUMBER\fP = \fIKEYSYMNAME ...\fP .\"0 The list of keysyms is assigned to the indicated keycode .\"0 (which may be specified in decimal, hex or octal and can be determined by .\"0 running the .\"0 .I xev .\"0 program. キーシムのリストを指示されたキーコードに割り当てる。(これは10,16,8進 数で指定することができ、 .I xev プログラムを起動して決める事が出来る。) .TP 8 .B keycode any = \fIKEYSYMNAME ...\fP .\"0 If no existing key has the specified list of keysyms assigned to it, .\"0 a spare key on the keyboard is selected and the keysyms are assigned to it. .\"0 The list of keysyms may be specified in decimal, hex or octal. もし、キーがそれ自身を指定するキーシムについての特定のリストを持たない 場合、キーボード上で代わりのキーが選択されて、そのキーシムが指定される。 キーシムのリストは10か16、あるいは8進数で指定される。 .TP 8 .B keysym \fIKEYSYMNAME\fP = \fIKEYSYMNAME ...\fP .\"0 The \fIKEYSYMNAME\fP on the left hand side is translated into matching keycodes .\"0 used to perform the corresponding set of \fBkeycode\fP expressions. .\"0 The list of keysym names may be .\"0 found in the header file \fI\fP (without the \fIXK_\fP prefix) .\"0 or the keysym database \fI/lib/X11/XKeysymDB\fP, where refers .\"0 to the root of the X11 install tree. .\"0 Note that if the same keysym is bound to multiple keys, the expression is .\"0 executed for each matching keycode. 左辺の .I KEYSYMNAME は、該当する .B keycode 表現の組合せを実行する際に使われる、それに適合したキーコードへ変換され る。キーシム名のリストはヘッダーファイル .I (XK_ プレフィックスなし) 中かあるいはキーシムのデータベースファイル .I /lib/X11/XKeysymDB 、ここで は X11 のインストールツリーのルート、に見出されるであ ろう。複数のキーに同じキーシムが結びつけられている時は、表現はそれぞれ の適合するキーコードに対して実行されることに注意すること。 .TP 8 .B clear \fIMODIFIERNAME\fP .\"0 This removes all entries in the modifier map for the given modifier, where .\"0 valid name are: .\"0 .BR Shift , .\"0 .BR Lock , .\"0 .BR Control , .\"0 .BR Mod1 , .\"0 .BR Mod2 , .\"0 .BR Mod3 , .\"0 .BR Mod4 , .\"0 and \fBMod5\fP (case .\"0 does not matter in modifier names, although it does matter for all other .\"0 names). For example, ``clear Lock'' will remove .\"0 all any keys that were bound to the shift lock modifier. これは modifier マップから与えられた modifier の全てのエント リを消去する。有効な modifier 名は: .BR Shift , .BR Lock , .BR Control , .BR Mod1 , .BR Mod2 , .BR Mod3 , .BR Mod4 , そして .B Mod5 である。( 他の名前には大文字小文字の区別があるが、modifier 名にはない) 例えば、clear Lock は shift lock modifier に結合されているあらゆるキーエントリを無効にするであろう。 .TP 8 .B add \fIMODIFIERNAME\fP = \fIKEYSYMNAME ...\fP .\"0 This adds all keys containing the given keysyms to the indicated modifier map. .\"0 The keysym names .\"0 are evaluated after all input expressions are read to make it easy to write .\"0 expressions to swap keys (see the EXAMPLES section). 与えられたキーシムを含む全てのキーを指定された modifier マップに加える。 キーの入れ換えの表現の記述を容易にするため、キーシム名は入力された表現 を全て読み込んだ後で評価される(EXAMPLEの節を参照)。 .TP 8 .B remove \fIMODIFIERNAME\fP = \fIKEYSYMNAME ...\fP .\"0 This removes all keys containing the given keysyms from the indicated .\"0 modifier map. Unlike .\"0 .B add, .\"0 the keysym names are evaluated as the line is read in. This allows you to .\"0 remove keys from a modifier without having to worry about whether or not they .\"0 have been reassigned. 与えられたキーシムを含む全てのキーを指定された modifier マップから消去 する。 .B add とは異なり、キーシム名は行が読み込まれるたびに評価される。 このことにより、キーがダブって指定されはしないだろうかという不安を抱く ことなく modifier からキーを消去することができる。 .TP 8 .B "pointer = default" .\"0 This sets the pointer map back to its default settings (button 1 generates a .\"0 code of 1, button 2 generates a 2, etc.). ポインタボタンのマップをデフォルト値に戻す。(ボタン 1 はコード 1 を生 成、ボタン 2 はコード 2 を生成…等々) .TP 8 .B pointer = \fINUMBER ...\fP .\"0 This sets to pointer map to contain the indicated button codes. The list .\"0 always starts with the first physical button. 指定されたボタンコードをポインタマップに含ませる。リストは常に物理ボ タンの一番目から指定すること。 .PP .\"0 Lines that begin with an exclamation point (!) are taken as comments. エクスクラメーションマーク(!)から始まる行はコメント行として扱われる。 .PP .\"0 If you want to change the binding of a modifier key, you must also remove it .\"0 from the appropriate modifier map. もし、modifer キーのバインディングを変更したい時は、適当な modifer マッ プからその modifier キーの消去もしなければいけない。 .SH 例 .PP .\"0 Many pointers are designed such that the first button is pressed using the .\"0 index finger of the right hand. People who are left-handed frequently find .\"0 that it is more comfortable to reverse the button codes that get generated .\"0 so that the primary button is pressed using the index finger of the left hand. .\"0 This could be done on a 3 button pointer as follows: .\"0 .EX .\"0 % xmodmap -e "pointer = 3 2 1" .\"0 .EE 多くのポインタは第1ボタンを右手の人差し指を使って押すように設計され ている。左利きの人は時に、良く使うボタンを左手の人差し指で押せるように、 ボタンに割り当てられているボタンコードの順序をひっくり返すとより使い心 地が良くなるということに気づく。このことは 3 ボタンポインタでは次のよ うにすればたぶん出来るだろう。 .EX % xmodmap -e "pointer = 3 2 1" .EE .PP .\"0 Many applications support the notion of Meta keys (similar to Control .\"0 keys except that Meta is held down instead of Control). However, .\"0 some servers do not have a Meta keysym in the default keymap table, so one .\"0 needs to be added by hand. .\"0 The following command will attach Meta to the Multi-language key (sometimes .\"0 labeled Compose Character). It also takes advantage of the fact that .\"0 applications that need a Meta key simply need to get the keycode and don't .\"0 require the keysym to be in the first column of the keymap table. This .\"0 means that applications that are looking for a Multi_key (including the .\"0 default modifier map) won't notice any change. .\"0 .EX .\"0 % xmodmap -e "keysym Multi_key = Multi_key Meta_L" .\"0 .EE 多くのアプリケーションはメタキー(コントロールの代わりにメタが押される 場合を除くと、コントロールキーと似ている)の概念をサポートしている。し かしながら幾つかのサーバはデフォルトのキーマップテーブルにメタキーのキー シムを持っていないので、手で追加する必要がある。 以下のコマンドはメタキーに多国語キー(時には組版文字が印字されている) の機能を付加する。メタキーを必要とするアプリケーションはキーコー ドのみを必要とし、キーマップテーブルの第 1 カラムに記述されているキーシ ムは必要としないという事実も利用する。これは Multi_key (デフォルトの modifier マップを含む)を探しているアプリケーションがキーシムのいかなる 置き換えに対しても気が付かないであろうということを意味する。 .EX % xmodmap -e "keysym Multi_key = Multi_key Meta_L" .EE .PP .\"0 Similarly, some keyboards have an Alt key but no Meta key. .\"0 In that case the following may be useful: .\"0 .EX .\"0 % xmodmap -e "keysym Alt_L = Meta_L Alt_L" .\"0 .EE 同様に、あるキーボードはメタキーを持たないかわりに ALT キーを持っている。 この場合には以下のコマンドが便利である。 .EX % xmodmap -e "keysym Alt_L = Meta_L Alt_L" .EE .PP .\"0 One of the more simple, yet convenient, uses of \fIxmodmap\fP is to set the .\"0 keyboard's "rubout" key to generate an alternate keysym. This frequently .\"0 involves exchanging Backspace with Delete to be more comfortable to the user. .\"0 If the \fIttyModes\fP resource in \fIxterm\fP is set as well, all terminal .\"0 emulator windows will use the same key for erasing characters: .\"0 .EX .\"0 % xmodmap -e "keysym BackSpace = Delete" .\"0 % echo "XTerm*ttyModes: erase ^?" | xrdb -merge .\"0 .EE 最も単純で、それでいて便利な .I xmodmap の利用法の一つはキーボードの "抹消" キーをもう一つのキーシムで代替するこ とである。このことはユーザにとってより快適になる、BS キーを DELETE キー と入れ換えるということも含んでいる。さらに、もし .I xterm での .I ttyModes リソースが設定されている場合には、全てのターミナルエミュレータのウィン ドウは同じキーを使って文字を消去する。 .EX % xmodmap -e "keysym BackSpace = Delete" % echo "XTerm*ttyModes: erase ^?" | xrdb -merge .EE .PP .\"0 Some keyboards do not automatically generate less than and greater than .\"0 characters when the comma and period keys are shifted. This can be remedied .\"0 with \fIxmodmap\fP by resetting the bindings for the comma and period with .\"0 the following scripts: .\"0 .EX .\"0 ! .\"0 ! make shift-, be < and shift-. be > .\"0 ! .\"0 keysym comma = comma less .\"0 keysym period = period greater .\"0 .EE 幾つかのキーボードは「コンマ + shift」と「ピリオド + shift」に対して自動 的に「<」と「>」を与えない。これはコンマとピリオドのキーバインディン グを以下のスクリプトによってリセットすることにより .I xmodmap で矯正することができる。 .EX ! ! make shift-, be < and shift-. be > ! keysym comma = comma less keysym period = period greater .EE .PP .\"0 One of the more irritating differences between keyboards is the location of the .\"0 Control and Shift Lock keys. A common use of \fIxmodmap\fP is to swap these .\"0 two keys as follows: .\"0 .EX .\"0 ! .\"0 ! Swap Caps_Lock and Control_L .\"0 ! .\"0 remove Lock = Caps_Lock .\"0 remove Control = Control_L .\"0 keysym Control_L = Caps_Lock .\"0 keysym Caps_Lock = Control_L .\"0 add Lock = Caps_Lock .\"0 add Control = Control_L .\"0 .EE キーボードの違いで、より苛立たせられることの一つはコントロールキーとシ フトロックキーの位置である。 .I xmodmap のありふれた使い方はこれら 2 つのキーを以下のコマンドで入れ換えること である。 .EX ! ! Caps_Lock と Control_L の入れ換え ! remove Lock = Caps_Lock remove Control = Control_L keysym Control_L = Caps_Lock keysym Caps_Lock = Control_L add Lock = Caps_Lock add Control = Control_L .EE .PP .\"0 The \fIkeycode\fP command is useful for assigning the same keysym to .\"0 multiple keycodes. Although unportable, it also makes it possible to write .\"0 scripts that can reset the keyboard to a known state. The following script .\"0 sets the backspace key to generate Delete (as shown above), flushes all .\"0 existing caps lock bindings, makes the CapsLock .\"0 key be a control key, make F5 generate Escape, and makes Break/Reset be a .\"0 shift lock. .\"0 .EX .\"0 ! .\"0 ! On the HP, the following keycodes have key caps as listed: .\"0 ! .\"0 ! 101 Backspace .\"0 ! 55 Caps .\"0 ! 14 Ctrl .\"0 ! 15 Break/Reset .\"0 ! 86 Stop .\"0 ! 89 F5 .\"0 ! .\"0 keycode 101 = Delete .\"0 keycode 55 = Control_R .\"0 clear Lock .\"0 add Control = Control_R .\"0 keycode 89 = Escape .\"0 keycode 15 = Caps_Lock .\"0 add Lock = Caps_Lock .\"0 .EE .I keycode コマンドは複数のキーコードに同じキーシムを指定する際便利である。 移植性はよくないものの、キーボードを、ある知られた状態にリセットするス クリプトを書くことができる。以下のスクリプトは BS キーに Delete の機能を 持たせ(上記を参照)、今ある caps lock のバインディングを全て消去し、 Capslock キーを Control キーに換え、F5 キーに Escape の機能を持たせ、 Break/Reset を shift lock にする。 .EX ! ! HP では以下の keycode は下記に挙げる key cap を持つ: ! ! 101 Backspace ! 55 Caps ! 14 Ctrl ! 15 Break/Reset ! 86 Stop ! 89 F5 ! keycode 101 = Delete keycode 55 = Control_R clear Lock add Control = Control_R keycode 89 = Escape keycode 15 = Caps_Lock add Lock = Caps_Lock .EE .SH 環境変数 .PP .TP 8 .B DISPLAY .\"0 to get default host and display number. はデフォルトのホスト名とディスプレイ番号を得る。 .SH 関連項目 .\"0 X(7), xev(1), \fIXlib\fP documentation on key and pointer events X(7), xev(1), .I Xlib のキーとポインタイベントに関するドキュメント。 .SH バグ .PP .\"0 Every time a \fBkeycode\fP expression is evaluated, the server generates .\"0 a \fIMappingNotify\fP event on every client. This can cause some thrashing. .\"0 All of the changes should be batched together and done at once. .\"0 Clients that receive keyboard input and ignore \fIMappingNotify\fP events .\"0 will not notice any changes made to keyboard mappings. .\"0 .PP .\"0 .I Xmodmap .\"0 should generate "add" and "remove" expressions automatically .\"0 whenever a keycode that is already bound to a modifier is changed. .\"0 .PP .\"0 There should be a way to have the .\"0 .I remove .\"0 expression accept keycodes as well as keysyms for those times when you really .\"0 mess up your mappings. .B keycode 表現が評価されるたびにサーバは各々のクライアントに対して .I MappingNotify イベントを生成する。このことが幾らかの問題を起こす。全ての変換はまとめ てバッチ処理され、同時に実行されてしまう。キーボード入力を受取り、 .I MappingNotify イベントを無視するクライアントはキーボードマッピングに対してなされた如 何なる変化にも気が付かない。 .PP ある modifier に規定されているキーコードが変更された場合は何時でも .I Xmodmap は "add" と "remove" 表現を自動的に生成してしまう。 .PP 表現はマッピングを台無しにしてしまった時のために キーシムと同様にキーコードも .I remove 表現が受け付けられるような方法を用意すべきである。 .SH 著者 .\"0 Jim Fulton, MIT X Consortium, rewritten from an earlier version by .\"0 David Rosenthal of Sun Microsystems. Jim Fulton, MIT X コンソーシアム。初期のバージョンはサンマイクロシステ ムズ社の David Rosenthal によって書かれた。