この節で示すキーの再マッピングスクリプト (Type-4 と Type-5 のキーボード用) を使って、キーボードの左右パネル上の大部分の特殊キー (つまり、キーボードの左側と右側にあるキーパッド) を再マッピングします。
この節の以降の説明はすべて、SPARC ベースのマシンだけに適用されるので注意してください。
再マッピングスクリプトを作成し使用する手順は次のとおりです。
任意のテキストエディタを使って、lefty.data というスクリプトファイルを作成します。
このファイルは、どのディレクトリにあってもかまいません。ただし 手順 4 は、このファイルを作成したのと同じディレクトリで実行しなければなりません。
後述の表 C-1 に示すスクリプトを入力します。
先頭に感嘆符 (!) が付いた行はコメント行で、実際の操作は実行しません。
ファイルを保存してエディタを終了します。
プロンプトに対して、次のコマンドを入力します。
$ xmodmap lefty.data |
上記のコマンドは、スクリプトファイル lefty.data と同じディレクトリ内で入力してください。
ワークスペース内でマウスボタンをクリックして、スクリプトの内容を有効にします。
上の手順を実行すると、左ききの人向けにマッピングされたキーボードを使えるようになります。
手順 1 で説明したように、次のスクリプトを lefty.data ファイルに入力します。
! ! lefty.data ! ! Data for xmodmap to set up the left and right function keys ! for left-handed use on Sun Type-4 keyboard. To use this data, ! type the following where <filename> is the name of the file ! (i.e., lefty.data). ! ! xmodmap <filename> ! ! The comments below correspond to the keycode assignments ! following immediately thereafter. ! |
! swap L2 (Again) with R1 (Pause) ! swap L3 (Props) with R6 (KP_Multiply) ! swap L4 (Undo) with R4 (KP_Equal) ! swap L5 (Front) with R9 (KP_9) ! swap L6 (Copy) with R7 (KP_7) ! swap L7 (Open) with R12 (KP_6) ! swap L8 (Paste) with R10 (KP_Left) ! swap L9 (Find) with R15 (KP_3) ! swap L10 (Cut) with R13 (KP_1) ! ! chng R3 (Break) to L1 (Stop) ! chng R2 (Print) to R10 (Left) ! chng R5 (KP_Divide) to R12 (Right) ! ! chng Linefeed to Control-R ! keycode 10 = R1 R1 Pause keycode 28 = L2 L2 SunAgain keycode 32 = R6 R6 KP_Multiply keycode 54 = L3 L3 SunProps keycode 33 = R4 R4 KP_Equal keycode 52 = L4 L4 SunUndo keycode 56 = R9 R9 KP_9 Prior keycode 77 = L5 L5 SunFront keycode 58 = R7 R7 KP_7 Home |
keycode 75 = L6 L6 SunCopy keycode 79 = Right R12 KP_6 keycode 100 = L7 L7 SunOpen keycode 80 = Left R10 KP_4 keycode 98 = L8 L8 SunPaste keycode 102 = R15 R15 KP_3 Next keycode 121 = L9 L9 SunFind keycode 104 = R13 R13 KP_1 End keycode 119 = L10 L10 SunCut keycode 30 = L1 L1 SunStop keycode 29 = Left R10 KP_4 keycode 53 = Right R12 KP_6 keycode 118 = Control_R add control = Control_R |
キーボードのキーの設定を元に戻すには、次の 2 つの方法があります。1 つは、OpenWindows を一度終了して再起動します。もう 1 つは、キー設定を元に戻すための別のスクリプトを作成して、必要に応じてそのスクリプトを実行します。2 番目の方法は、キー設定を定期的に再設定する場合に望ましい方法です。
再設定用のスクリプトを作成するには、次の手順を実行します。
任意のテキストエディタを使って、nolefty.data というスクリプトファイルを作成します。
このファイルは、lefty.data スクリプトと同じディレクトリに作成してください。
後述の表 C-2 に示すスクリプトを入力します。
先頭に感嘆符 (!) が付いた行はコメント行で、実際の操作は実行しません。
ファイルを保存してエディタを終了します。
コマンドプロンプトに対して、次のコマンドを入力します。
$ xmodmap nolefty.data |
nolefty.data ファイルを有効にするには、上記のコマンドを nolefty.data が存在するディレクトリで実行してください。
! ! nolefty.data ! ! Data for xmodmap to reset the left and right function keys ! after being set for left-handed use on the Sun type-4 keyboard. ! To use this data, type the following where <filename> is the name ! of the file. ! ! xmodmap <filename> ! ! Reassign standard values to left function keys. ! keycode 10 = L2 L2 SunAgain keycode 32 = L3 L3 SunProps keycode 33 = L4 L4 SunUndo keycode 56 = L5 L5 SunFront keycode 58 = L6 L6 SunCopy keycode 79 = L7 L7 SunOpen keycode 80 = L8 L8 SunPaste keycode 102 = L9 L9 SunFind keycode 104 = L10 L10 SunCut ! ! Reassign standard values to right function keys. ! keycode 28 = R1 R1 Pause keycode 29 = R2 R2 Print keycode 30 = R3 R3 Scroll_Lock Break keycode 52 = R4 R4 KP_Equal keycode 53 = R5 R5 KP_Divide keycode 54 = R6 R6 KP_Multiply keycode 75 = R7 R7 KP_7 Home keycode 77 = R9 R9 KP_9 Prior keycode 98 = Left R10 KP_4 keycode 100 = Right R12 KP_6 keycode 119 = R13 R13 KP_1 End keycode 121 = R15 R15 KP_3 Next ! ! Reassign the Linefeed key as such and remove from control map. ! remove control = Control_R keycode 118 = Linefeed |