I lost this setup in an upgrade and now I cannot create this
customization again :-(
Anyone know of what I'm talking?
Thanks in advance!
..Per
In recent versions of Mac OS X (I think back to 10.4) cmd-opt-8 is a
shortcut used by the OS to enable/disable the screen zooming feature.
The OS steals these keystrokes before Mathematica ever sees them. If
you don't use this feature you can remove/disable the shortcut for it
by unchecking the checkbox at System Preferences > Keyboard > Keyboard
Shortcuts > Universal Access > Turn zoom on or off. With this
shortcut disabled you will be able edit your MenuSetup.tr or
KeyEventTranslations.tr to use this key combination.
-Rob
To achieve this I change the file
/Applications/Mathematica.app/SystemFiles/FrontEnd/TextRessources/
Macitosh/KeyEventTranslations.tr
Add the following to this file: (BE CAREFUL, ALWAYS MAKE A COPY OF THIS
FILE BEFORE EDITING IT, IF YOU MADE A MISTAKE, MATHEMATICA WILL NOT WORK
ANY MORE)
Item[KeyEvent["<",Modifiers->{Control}],
FrontEndExecute[{FrontEnd`NotebookWrite[FrontEnd`SelectedNotebook[],
"\[LeftDoubleBracket]\[RightDoubleBracket]",After],
FrontEndToken["MovePrevious"]}]]
Now Ctrl+ < will bring up the opening and closing double-brackets with
the Cursor placed in between.
I changed the other parentheses, brackets and braces the some way, e.g.
Item[KeyEvent["("],
FrontEndExecute[{FrontEnd`NotebookWrite[FrontEnd`SelectedNotebook[],
"()",After], FrontEndToken["MovePrevious"]}]]
--
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de
Item[KeyEvent["[", Modifiers -> {Control}],
FrontEndExecute[{FrontEnd`NotebookWrite[FrontEnd`InputNotebook[],
"\[LeftDoubleBracket]", After]}]],
Item[KeyEvent["]", Modifiers -> {Control}],
FrontEndExecute[{FrontEnd`NotebookWrite[FrontEnd`InputNotebook[],
"\[RightDoubleBracket]", After]}]],
For future reference: http://qwan.org/2009/03/26/typing-=E2=9F=A6-and-=E2=
=9F=A7-in-mathematica/#comments
Thanks to you both!
..Per
On Jan 5, 7:49=C2 am, Peter Breitfeld <ph...@t-online.de> wrote:
> "perda...@gmail.com" wrote:
> > In a previous installation of Mathematica, I had (on a Mac) Command-
> > Alt-8 bound to the character representing double-[ for use in list
> > indexing.
>
> > I lost this setup in an upgrade and now I cannot create this
> > customization again :-(
>
> > Anyone know of what I'm talking?
>
> > Thanks in advance!
>
> > ..Per
>
> To achieve this I change the file
> /Applications/Mathematica.app/SystemFiles/FrontEnd/TextRessources/
> =C2 Macitosh/KeyEventTranslations.tr
>
> Add the following to this file: (BE CAREFUL, ALWAYS MAKE A COPY OF THIS
> FILE BEFORE EDITING IT, IF YOU MADE A MISTAKE, MATHEMATICA WILL NOT WORK
> ANY MORE)
>
> Item[KeyEvent["<",Modifiers->{Control}],
> =C2 =C2 =C2 FrontEndExecute[{FrontEnd`NotebookWrite[FrontEnd`Sel=
ectedNotebook[],
> =C2 =C2 =C2 =C2 "\[LeftDoubleBracket]\[RightDoubleBracket]",A=
fter],
> =C2 =C2 =C2 =C2 =C2 =C2 =C2 FrontEndToken["MovePrevi=
ous"]}]]
>
> Now Ctrl+ < =C2 will bring up the opening and closing double-brackets w=
ith
> the Cursor placed in between.
>
> I changed the other parentheses, brackets and braces the some way, e.g.
>
> Item[KeyEvent["("],
> =C2 =C2 =C2 FrontEndExecute[{FrontEnd`NotebookWrite[FrontEnd`Sel=
ectedNotebook[],
> =C2 =C2 =C2 =C2 "()",After], FrontEndToken["MovePrevious"]}]]