MathGroup Archive 1998

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

Search the Archive

Cell bracket <-> Inline



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




  • Prev by Date: 3D problem
  • Next by Date: Re: I don't understand in Mathematic
  • Prev by thread: RE: 3D problem
  • Next by thread: Re: Cell bracket <-> Inline