#
# Bindings for Teacher Hypertools
#

foreach element {

# The format here is:
# Binding 	  Key & More Keys 	In Menu: Name:  Underline:
{Focus_Next	  <Meta-n> 		{{Focus 1} {Next 0}}}
{Focus_Previous   <Meta-p> 		{{Focus 1} {Previous 0}}}

{Shrink_Y <Control-bracketleft>	{{Window 0} {Resize 2} {"Shrink Vertically" 1}}}
{Expand_Y <Control-braceleft>	{{Window 0} {Resize 2} {"Expand Vertically" 1}}}
{Shrink_X <Control-bracketright> {{Window 0} {Resize 2} {"Shrink Horizontally" 0}}}
{Expand_X <Control-braceright>	{{Window 0} {Resize 2} {"Expand Horizontally" 0}}}

{Iconify_Window	  <Meta-I>		{{Window 0} {Iconify 0}}}
{Raise_Window 	  <Meta-i>		{{Window 0} {Raise 0}}}
{Move_Up          <Meta-bracketleft>	{{Window 0} {Move 0} {Up 0}}}
{Move_Down 	  <Meta-braceleft>	{{Window 0} {Move 0} {Down 0}}}
{Move_Left   	  <Meta-bracketright>	{{Window 0} {Move 0} {Left 0}}}
{Move_Right       <Meta-braceright>	{{Window 0} {Move 0} {Right 0}}}
{Move_Edge_Top	  <Meta-Control-bracketleft> 	{{Window 0} {Move 0} {"Top Edge" 0}}}
{Move_Edge_Left	  <Meta-Control-bracketright> 	{{Window 0} {Move 0} {"Left Edge" 5}}}

{Grid_X 	  <Meta-x>	{{Window 0} {"Horizontal Grid" 0}} Grid_X,%W}
{Grid_Y 	  <Meta-y>	{{Window 0} {"Vertical Grid" 0}}   Grid_Y,%W}

{Tags 		  {} 			{{Index 0} {Tags 0} {Useless 0}}}

{Iterate	  <Meta-T>		{{Extras 1} {Iterate 1}}}

{Read_File 	  <Meta-r>		{{File 0} {Revert 1}}}
{Read_File_Prompt <Meta-R>		{{File 0} {Read 0}}}
{Save_File 	  <Meta-s> 		{{File 0} {Save 0}}}
{Save_File_Prompt <Meta-S>		{{File 0} {"Save As" 5}}}
{Insert_File 	  <Meta-Control-r>	{{File 0} {Insert 0}}}
{Use_Pipe 	  {}			{{File 0} {"Use a Pipe" 6}} Pipe}
{Check_Mtime 	  <Enter>}

{Scroll_Line_Begin  <Meta-z>	{{Browse 0} {Scroll 0} {Line 0} {Up 0}}}
{Scroll_Line_End    <Control-z> {{Browse 0} {Scroll 0} {Line 0} {Down 0}}}
{Scroll_Line_Left   <Meta-Z> 	{{Browse 0} {Scroll 0} {Line 0} {Left 0}}}
{Scroll_Line_Right  <Control-Z> {{Browse 0} {Scroll 0} {Line 0} {Right 0}}}
{Scroll_Page_Begin  <Meta-quoteleft> 	{{Browse 0} {Scroll 0} {Page 0} {Up 0}}}
{Scroll_Page_End    <Control-quoteleft> {{Browse 0} {Scroll 0} {Page 0} {Down 0}}}
{Scroll_Page_Left   <Meta-asciitilde>	{{Browse 0} {Scroll 0} {Page 0} {Left 0}}}
{Scroll_Page_Right  <Control-asciitilde> {{Browse 0} {Scroll 0} {Page 0} {Right 0}}}
{Center_Cursor 	    <Control-l> {{Browse 0} {Scroll 0} {"Center Cursor" 0}}}
{Goto_Char_Left     <Control-b> {{Browse 0} {Goto 0} {Character 0} {Left 0}}}
{Goto_Char_Right    <Control-f>	{{Browse 0} {Goto 0} {Character 0} {Right 0}}}
{Goto_Char_Up      <Control-p> {{Browse 0} {Goto 0} {Character 0} {Previous 0}}}
{Goto_Char_Down     <Control-n>	{{Browse 0} {Goto 0} {Character 0} {Next 0}}}
{Goto_Char_PUp      <Meta-comma> {{Browse 0} {Goto 0} {Character 0} {Up 0}}}
{Goto_Char_PDown    <Meta-period> {{Browse 0} {Goto 0} {Character 0} {Down 0}}}
{Goto_Word_Left     <Meta-b> 	{{Browse 0} {Goto 0} {Word 0} {Left 0}}}
{Goto_Word_Right    <Meta-f> 	{{Browse 0} {Goto 0} {Word 0} {Right 0}}}
{Goto_Screen_Left   <Control-comma> {{Browse 0} {Goto 0} {Screen 0} {Left 0}}}
{Goto_Screen_Right  <Control-period> {{Browse 0} {Goto 0} {Screen 0} {Right 0}}}
{Goto_Screen_Up	    <Control-less> {{Browse 0} {Goto 0} {Screen 0} {Up 0}}}
{Goto_Screen_Down   <Control-greater> {{Browse 0} {Goto 0} {Screen 0} {Down 0}}}
{Goto_Edge_Begin    <Control-a>	{{Browse 0} {Goto 0} {Edge 0} {Left 0}}}
{Goto_Edge_End      <Control-e> {{Browse 0} {Goto 0} {Edge 0} {Right 0}}}
{Goto_Edge_Top      <Meta-less>	{{Browse 0} {Goto 0} {Edge 0} {Up 0}}}
{Goto_Edge_Bottom   <Meta-greater> {{Browse 0} {Goto 0} {Edge 0} {Down 0}}}
{Goto_Mark 	    <Control-x> {{Browse 0} {Goto 0} {Anchor 0}}}
{Center_Screen      <Control-L>	{{Browse 0} {Goto 0} {"Center of Screen" 5}}}
{Goto 		    <Meta-g> 	{{Browse 0} {Goto 0} {"Specify an Index" 11}}}
{Select_Line 	    <Control-K>	{{Browse 0} {Select 1} {Line 0}}}
{Select_Region 	    <Control-Shift-space> {{Browse 0} {Select 1} {Region 0}}}
{Select_All 	    <Control-slash> 	{{Browse 0} {Select 1} {All 0}}}
{Select_Clear 	    <Control-backslash> {{Browse 0} {Select 1} {Clear 0}}}
{Select_Copy 	    <Meta-w>    {{Browse 0} {Select 1} {Copy 1}}}
{Mark 		    <Control-space> 	{{Browse 0} {Anchor 0}}}

{Undo 		  <Meta-Control-u>	{{Edit 0} {Undo 0} {Undo 0}}}
{Show_Last_Undo   <Meta-Control-l> 	{{Edit 0} {Undo 0} {"Show Last" 5}}}
{Kill_Undo_Log 	  <Meta-Control-k> 	{{Edit 0} {Undo 0} {"Kill Undo Log" 0}}}
{Yank 		  <Control-y> 		{{Edit 0} {Paste 0} {Clipboard 0}}}
{Paste 		  <Control-v> 		{{Edit 0} {Paste 0} {Selection 0}}}
{B2-Paste 	  <ButtonRelease-2>}
{Toggle_Overwrite <Meta-o> 	{{Edit 0} {"Toggle Overwrite" 7}} Overwrite,%W}
{Self_Insert	  <Key>}
{Newline 	  {<Return> <Control-m> <Key-KP_Enter>}}
{Quote 		  <Control-q> 		{{Edit 0} {Quote 0}}}
{Kill_Line 	  <Control-c> 		{{Edit 0} {Cut 0} {Line 0}}}
{Kill_Region 	  <Control-w> 		{{Edit 0} {Cut 0} {Region 0}}}
{Kill_All 	  <Control-u> 		{{Edit 0} {Cut 0} {All 0}}}
{Delete_Char_Backward {<Control-h> <BackSpace>}	{{Edit 0} {Delete 0} {Character 0} {Previous 0}}}
{Delete_Char_Forward <Control-d> 	{{Edit 0} {Delete 0} {Character 0} {Next 0}}}
{Delete_Word_Backward {<Meta-h> <Meta-BackSpace>} {{Edit 0} {Delete 0} {Word 0} {Previous 0}}}
{Delete_Word_Forward <Meta-d> 		{{Edit 0} {Delete 0} {Word 0} {Next 0}}}
{Delete_Line 	  <Control-k> 		{{Edit 0} {Delete 0} {Line 0}}}
{Delete_Selection {<Control-BackSpace> <Delete>}	{{Edit 0} {Delete 0} {Selection 0}}}
{Uppercase_Region <Meta-u>		{{Edit 0} {Case 1} {Upper 0}}}
{Lowercase_Region <Meta-l>		{{Edit 0} {Case 1} {Lower 0}}}
{Capitalize_Region <Meta-c>		{{Edit 0} {Case 1} {Capitalize 0}}}
{Transpose_Chars  <Control-t>		{{Edit 0} {Transpose 0} {Characters 0}}}
{Transpose_Words  <Meta-t>		{{Edit 0} {Transpose 0} {Words 0}}}
{Split_Line 	  <Control-o> 		{{Edit 0} {"Split Line" 0}}}
{Indent_Region 	  <Control-i> 		{{Edit 0} {Indent 0} {Insert 0}}}
{Delete_Indent 	  <Control-I>		{{Edit 0} {Indent 0} {Delete 0}}}

{Search_Forward         <Control-s> 	{{Search 0} {String 0} {Forward 0}}}
{Search_Backward        <Control-r> 	{{Search 0} {String 0} {Reverse 0}}}
{Search_Forward_Regexp  <Control-S>	{{Search 0} {Regexp 0} {Forward 0}}}
{Search_Backward_Regexp <Control-R> 	{{Search 0} {Regexp 0} {Reverse 0}}}
{Toggle_Case_Sensitivity <Meta-Control-c> {{Search 0} {"Case Inensitive" 0}} Search,Case,%W}
{Toggle_Incremental_Search <Meta-C> {{Search 0} {"Incremental Search" 0}} Search,Incremental,%W}
{Highlight_Searches 	<Meta-Control-l> {{Search 0} {Highlight 4}}}
{Replace_One 		<Control-c> 	 {{Search 0} {"Replace One" 8}}}
{Replace_All 		<Control-C> 	 {{Search 0} {"Replace All" 8}}}

{Complete_Word	  <Escape>		{{Extras 1} {Complete 0}}}
{Show_Completions <Control-Escape>	{{Extras 1} {"Show Completions" 0}}}

{Check_Exp_Self	  <Key>}
{Check_Exp 	  <Meta-space>	{{Extras 0} {"Check Expression" 0}}}
{Goto_Exp_Left 	  <Meta-a>	{{Browse 0} {Goto 0} {Expression 1} {Left 0}}}
{Goto_Exp_Right	  <Meta-e>	{{Browse 0} {Goto 0} {Expression 1} {Right 0}}}
{Select_Exp 	  <Meta-Shift-space> 	{{Browse 0} {Select 0} {Expression 1}}}

{Next_Para  	  <Control-N>   {{Browse 0} {Goto 0} {Paragraph 0} {Next 0}}}
{Prev_Para  	  <Control-P>  {{Browse 0} {Goto 0} {Paragraph 0} {Previous 0}}}
{Select_Para 	  <Control-j>   {{Browse 0} {Select 0} {Paragraph 0}}}
{Join_Para 	  <Control-J> 	{{Edit 0} {Paragraph 0} {Join 0}}}
{Split_Para   	  <Control-T> 	{{Edit 0} {Paragraph 0} {Split 4}}}
{Reformat_Para 	  <Meta-j>  	{{Edit 0} {Paragraph 0} {Format 1}}}
{Narrow_Para 	  <Meta-J>   {{Extras 0} {"Narrow Paragraphs" 7}} Para,Narrow,%W}

{Next_C_Fn   <Control-N> {{Browse 0} {Goto 0} {Function 0} {Next 0}}}
{Prev_C_Fn   <Control-P> {{Browse 0} {Goto 0} {Function 0} {Previous 0}}}
{Select_C_Fn <Control-J>	{{Browse 0} {Select 0} {Function 0}}}
{Select_C_Comment   <Control-j> {{Browse 0} {Select 0} {Comment 0}}}
{Reformat_C_Comment <Meta-j> 	{{Edit 0} {"Format Comment" 0}}}

{Next_Lisp_Fn   <Control-N> {{Browse 0} {Goto 0} {Defun 0} {Next 0}}}
{Prev_Lisp_Fn   <Control-P> {{Browse 0} {Goto 0} {Defun 0} {Previous 0}}}
{Select_Lisp_Fn <Control-J> {{Browse 0} {Select 0} {Defun 0}}}
{Select_Lisp_Comment   <Control-j> {{Browse 0} {Select 0} {Comment 0}}}
{Reformat_Lisp_Comment <Meta-j>    {{Edit 0} {"Format Comment" 0}}}

{Next_Tcl_Fn   <Control-N> {{Browse 0} {Goto 0} {Procedure 0} {Next 0}}}
{Prev_Tcl_Fn   <Control-P> {{Browse 0} {Goto 0} {Procedure 0} {Previous 0}}}
{Select_Tcl_Fn <Control-J> {{Browse 0} {Select 0} {Procedure 0}}}
{Select_Tcl_Comment <Control-j> {{Browse 0} {Select 0} {Comment 0}}}
{Reformat_Tcl_Comment  <Meta-j> {{Edit 0} {"Format Comment" 0}}}

{Next_Markup  	  <Control-N>   {{Browse 0} {Goto 0} {Markup 0} {Next 0}}}
{Prev_Markup  	  <Control-P>   {{Browse 0} {Goto 0} {Markup 0} {Previous 0}}}
{Select_Markup    <Control-j> 	{{Browse 0} {Select 0} {Markup 0}}}
{Select_Anchor 	  <Control-J> 	{{Browse 0} {Select 0} {Anchor 0}}}

{Wish_Command  	  <Meta-W>	{{Command 0} {Wish 0}}}
{Exec_Command  	  <Meta-E>	{{Command 0} {Exec 0}}}
{Use_Input  	  {}		{{Command 0} {"Get Input" 4}} Cmd,Input,%W}
{Use_Output  	  {}		{{Command 0} {"Insert Output" 7}} Cmd,Output,%W}
{Print  	  <Meta-O>	{{Command 0} {Commands 0} {Print 0}}}
{Mail   	  <Meta-A>	{{Command 0} {Commands 0} {Mail 1}}}

{Forward_File	  <Meta-F> 		{{File 0} {Browse 0} {Forward 0}}}
{Backward_File	  <Meta-B>  		{{File 0} {Browse 0} {Backward 0}}}
{Down_File 	  <Meta-N>  		{{File 0} {Browse 0} {Down 3}}}
{Up_File	  <Meta-P>   		{{File 0} {Browse 0} {Up 1}}}

{Mark_Text 	  <Control-Key-M>	{{Browse 0} {Mark 0} {Mark 0}}}
{Unmark_Text 	  <Meta-Key-M> 		{{Browse 0} {Mark 0} {Unmark 0}}}
{Forward_Mark 	  <Control-F> 	{{Browse 0} {Goto 0} {Mark 0} {Forward 0}}}
{Backward_Mark 	  <Control-B> 	{{Browse 0} {Goto 0} {Mark 0} {Backward 0}}}

{Update_Page	  <Control-U>	{{Index 0} {"Update Page" 7}}}
{Update_All	  <Meta-U>	{{Index 0} {"Update All" 7}}}

{X_Scrollbar 	  <Meta-X>	{{Window 0} {"X Scrollbar" 0}} Scrollbar,X,%W}
{Y_Scrollbar 	  <Meta-Y>	{{Window 0} {"Y Scrollbar" 0}} Scrollbar,Y,%W}

{Switch_Buffer 	  <Meta-V> 		{{Focus 1} {Window 0}}}
{Move_Below_Last  <Meta-Control-m> 	{{Window 0} {Move 0} {"Below Last" 0}}}
{All_Shown	  <Meta-slash>		{{Focus 1} {"All Shown Windows" 1}}}
{All_Windows 	  <Meta-question>	{{Focus 1} {"All Windows" 0}}}

{Toggle_Menus 	  <Button-3>}
{Add_Para_Module  <Meta-Key-1> 		{{Modules 0} {Paragraph 0}}}
{Add_Tcl_Module   <Meta-Key-2> 		{{Modules 0} {"Tcl/Tk" 0}}}
{Add_C_Module     <Meta-Key-3> 		{{Modules 0} {"C/C++" 0}}}
{Add_Lisp_Module  <Meta-Key-4> 		{{Modules 0} {"Lisp/Scheme" 0}}}
{Add_HTML_Module  <Meta-Key-5>		{{Modules 0} {"HTML" 0}}}

{OK {<Return> <Control-m> <Key-KP_Enter>} {{Extras 1} {OK 0}}}
{Cancel		  <Control-g> 		{{Extras 1} {Abort 0}}}

{Quit 		  <Meta-q> 		{{File 0} {Quit 0} {"Forget View" 0}}}
{Quit_Remember	  <Meta-Q> 		{{File 0} {Quit 0} {"Remember View" 0}}}
{Visit_File_Prompt  <Meta-Control-v> 	{{File 0} {Visit 0}}}
{Visit_File	  {<Meta-v> <Control-Double-Button-1>} 	{{File 0} {"Visit Implicit" 4}}}
{Help 		  <Meta-Control-h> 	{{Command 0} {Commands 0} {Help 0}}}
{Show_X 	  <Meta-Control-x>  	{{Command 0} {Commands 0} {"Show X Selection" 5}}}
{Make 		  <Meta-m> 		{{Command 0} {Commands 0} {Make 0}}}

} {set All_Bindings([lindex $element 0]) [lrange $element 1 end]}
