### Copyright (C) 1995, 1996, 1997 Jeppe Buk (buk@imada.ou.dk) ### This program is free software; you can redistribute it and/or modify ### it under the terms of the GNU General Public License as published by ### the Free Software Foundation; either version 2 of the License, or ### (at your option) any later version. ### ### This program is distributed in the hope that it will be useful, ### but WITHOUT ANY WARRANTY; without even the implied warranty of ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ### GNU General Public License for more details. ### ### You should have received a copy of the GNU General Public License ### along with this program; if not, write to the Free Software ### Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ### ### Sun Feb 22 1998 Japanized by Mashio Motoyama ### proc keys {} { # メニューとバインド / キー・バインディング Desc "キー・バインディングの定義" ShortDesc "キー・バインディング" Header h -text "キー・バインディング" -frame:relief flat \ -help "このページではキー・バインディングの定義をします。" Line l Label index -text "Desc:" -label:relief groove -packLabel:ipadx 5 ComboBox keysym -text "キーシム" -entries { Left Right Up Down F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 L1 L2 L3 L4 L5 L6 L7 L8 L9 L10 a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z } \ -packFrame:anchor nw \ -help " リストからキーシムを選んで下さい。"\ "もし一覧に無ければ手打ちになります。" ListBox keyContext -text "コンテキスト" -entries { Any Root Window "Title bar" Sides Frame Icon "0 button" "1 button"\ "2 button" "3 button" "4 button" "5 button" "6 button" "7 button" \ "8 button" "9 button"} -width 8 \ -selectmode multiple \ -help "この機能を割り当てるコンテキストを選択します。" ListBox keyModifier -text "モディファイア" -entries { Any Control Shift Meta 1mod 2mod 3mod 4mod 5mod} -width 8 \ -selectmode multiple \ -help "そのキーと組み合わせて使う装飾キーを選択します" Label funcLabel -text "呼び出す関数" \ -help "キーにバインド可能な組み込み関数の一覧です。" global Builtins ComboBox builtinCall -noedit 1 -default Beep -entryhelp $Builtins \ -help "このメニューから呼び出す組み込み関数を選択します。" Label argLabel -text "引数" \ -help "付加的な引数を記述します(その文法はあなたの自身が責任を持って下さい)。そのコマンドのヘルプを見て下さい。" Entry keyArgs \ -help "付加的な引数を記述します(その文法はあなたの自身が責任を持って下さい)。そのコマンドのヘルプを見て下さい。" Frame called -entries {funcLabel builtinCall argLabel keyArgs} -orient top Frame keyFrame -entries {keyContext keyModifier called} ExtEntry keys -lines 1 -count 1 -entries {index keysym keyFrame} \ -index index -orient top Label funcArgs -justify left -wraplength 400 Change { if {$changeElm == "builtinCall"} { set bcindex -1 set found "no" foreach bc $Builtins { incr bcindex if {$bc == $builtinCall} { set found "yes" break } } if {$found == "yes"} { set help [lindex $Builtins [expr $bcindex + 1]] } else { set help "\[Help not found\]" } set funcArgs "\"$builtinCall\" のヘルプ:\n$help" eval "[pick [funcWithArgs $builtinCall] Enable Disable] argLabel keyArgs" } } ShowPage { set funcArgs "" } PageEnd { forevery keys { if {$keysym == ""} { error "キーバインディングのキーシムを定義して下さい。" } if { [llength $keyContext(name)] == 0 } { error "キーバインディングのコンテキストを定義して下さい。" } } } Change { if {$changeElm == "keyModifier" || $changeElm == "keysym" || $changeElm == "keyContext"} { set index "Key: [makeContextOrModifier $keyModifier(name)] $keysym, Context: [makeContextOrModifier $keyContext(name)]" } } Save { forevery keys { set context [makeContextOrModifier $keyContext(name)] set modifier [makeContextOrModifier $keyModifier(name)] print "Key $keysym $context $modifier $builtinCall $keyArgs" } } }