MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Cell bracket <-> Inline



hi Carl,

I'm puzzled by the Frontend's handling of these key events, and a bit
wary of getting hopelessly lost when medling about in these things. On
my machine, the insert as below doesn't work (tried it with Command and
Control as modifiers).
I have the impression that this part of the software isn't really
compatible with the "Microsoft Win'95 PC" type keyboards.

I have achieved an andvantage though : if I walk the cursor down (in
bracket selection) over a closed cell, it doesn't open up anymore.
That's good, I wanted that effect! (what the Lord has closeth, no
cursor movement shall openeth ..(;-))

Thanx for looking in to this,
wouter.

        . . .
	Item[KeyEvent[Up], "MovePreviousLine"], 
	Item[KeyEvent[Down], "MoveNextLine"],  (* added 24/01/98 mail Carl Woll
*)
	 Item[KeyEvent[Down, Modifiers->{Command}],
      FrontEndExecute[{
        
FrontEnd`SelectionMove[FrontEnd`SelectedNotebook[],After,CellContents]
      			}]  ],
(* end new key event from cell bracket to in-line selection *)
	Item[KeyEvent[Left], "MovePrevious"], 
	Item[KeyEvent[Right], "MoveNext"], 
	Item[KeyEvent[Right, Modifiers -> {Option}], "MoveNextWord"], 
	Item[KeyEvent[Left, Modifiers -> {Option}], "MovePreviousWord"], 
        . . .

At 12:38 21-01-98 -0800, C. Woll wrote:
>Hi Wouter,
>
>A while ago you wanted to know if there was a way to go from cell bracket
>selection to inline selection. I have one way to do this.
>
>Find the file KeyEventTranslations.tr which is located in the
>SystemFiles/FrontEnd/TextResources directory. In this file you should have
>something like
>
>EventTranslations[{
>	Item[KeyEvent[...
>}]
>
>The trick is to add new keyevents which will do what you want. For
>example, I added the following:
>
>EventTranslations[{
>   Item[KeyEvent[Down, Modifiers->{Command}],
>      FrontEndExecute[{
>         FrontEnd`SelectionMove[FrontEnd`SelectedNotebook[],After,CellContents]
>      }]
>   ],
>   Item[KeyEvent[Up, Modifiers->{Command}],
>      FrontEndExecute[{
>
FrontEnd`SelectionMove[FrontEnd`SelectedNotebook[],After,CellContents],
>
FrontEnd`SelectionMove[FrontEnd`SelectedNotebook[],Before,CellContents]
>      }]
>   ],
>   Item[KeyEvent[".", Modifiers->{Command,Control}]
>      FrontEndExecute[{
>         FrontEnd`SelectionMove[FrontEnd`SelectedNotebook[],All,Cell],
>      }]
>   ],
>   ...
>}]
>
>For some reason, the command with 
>
>Before,CellContents
>
>doesn't do what you expect, so I needed to do a more complicated set of
>instructions.
>
>After you made the above changes, Command-Up and Command-Down will take
>you from cell bracket to inline, with Up taking you to the beginning of
>the cell, and Down taking you to the end of the cell (this will also work
>when the selector is inline), and Command-Control-. will take you from
>inline selection to cell bracket selection. I used Command-Control-. since
>the behavior I wanted was similar to Extend Selection (Control-.) but
>Command-. was already taken (abort evaluation).
>
>Let me know if this does what you want.
>
>Carl Woll
>Dept of Physics
>U of Washington
>
>
Dr. Wouter L. J. MEEUSSEN
w.meeussen.vdmcc@vandemoortele.be
eu000949@pophost.eunet.be




  • Prev by Date: Announcement of PYML (Python/Mathematica Interface)
  • Next by Date: Saving animation frames
  • Prev by thread: Re: Cell bracket <-> Inline
  • Next by thread: Customizing your keyboard by creating new aliases