I note in the Help page "Keyboard Shortcut Listing" that for example entering Alt+] gives the pair of single brackets [] with the cursor between them.
No such shortcut is listed for the double brackets [[ ....]]. Can this be added to one's installation of Mathematica? I seem to be doing "Esc [ [ Esc Esc ] ] Esc left arrow" quite a lot in a Windows 7 system.
Barrie
Double brackets... without learning a new shortcut.
Bobby
On your Windows machine, does Alt+] and then Alt+] again give the same
result as my 9 keystroke sequence "Esc [ [ Esc Esc ] ] Esc left_arrow",
i.e. the pair of characters represented at the Expression level by
\[LeftDoubleBracket] and \[RightDoubleBracket], with cursor in the
middle (achieved by my left-arrow)?
If it does, then sacre bleu! It doesn't on my PC; first thing I tried.
Otherwise, ...
I want the nice notation without 9 keystrokes each time.
Barrie
>>> On 20/01/2011 at 10:37 am, in message
<op.vpkw8...@bobbys-imac.local>,
Re:"Why not simply do the shortcut twice to obtain [[]]",
because I want the notation to be same as the result of my "Esc [ [ Esc Esc ] ] Esc left arrow" keystroke sequence, i.e. I want not the repeated single "[" and "]", but the pair of symbols represented at the Expression level by \[LeftDoubleBracket] and \[RightDoubleBracket].
The only key on a PC that could be thought of as equivalent to the Macintosh Command key is the "Windows" key, and it doesn't seem to play the same role. On my Windows 7 system, Alt+] is sufficient to get the pair of single brackets [] with the cursor between them.
Barrie
>>> On 20/01/2011 at 4:41 am, in message
<OFFAEBBE61.CF534136-ON852578...@terc.edu>, David
Carraher <david_c...@terc.edu> wrote:
> Barrie,
>
> BTW, the shortcut on a Mac seems to be Alt+Command+]
>
> Why not simply do the shortcut twice to obtain [[]] ?
> It works for me.
>
> David
(And I never touch a Windows machine, for fear of getting some terrible
infection, like gangrene.)
Bobby
On Wed, 19 Jan 2011 17:51:08 -0600, Barrie Stokes
<Barrie...@newcastle.edu.au> wrote:
> Hi Bobby
>
> On your Windows machine, does Alt+] and then Alt+] again give the same
> result as my 9 keystroke sequence "Esc [ [ Esc Esc ] ] Esc left_arrow",
> i.e. the pair of characters represented at the Expression level by
> \[LeftDoubleBracket] and \[RightDoubleBracket], with cursor in the
> middle (achieved by my left-arrow)?
>
> If it does, then sacre bleu! It doesn't on my PC; first thing I tried.
> Otherwise, ...
>
> I want the nice notation without 9 keystrokes each time.
>
> Barrie
>
>>>> On 20/01/2011 at 10:37 am, in message
> <op.vpkw8...@bobbys-imac.local>,
> DrMajorBob <btr...@austin.rr.com> wrote:
>> Just push the one for brackets TWICE, and voil=E1!
>>
>> Double brackets... without learning a new shortcut.
>>
>> Bobby
>>
>> On Wed, 19 Jan 2011 04:30:17 -0600, Barrie Stokes
>> <Barrie...@newcastle.edu.au> wrote:
>>
>>> Hi All
>>>
>>> I note in the Help page "Keyboard Shortcut Listing" that for example
>
>>> entering Alt+] gives the pair of single brackets [] with the cursor
>
>>> between them.
>>> No such shortcut is listed for the double brackets [[ ....]]. Can
> this
>>> be added to one's installation of Mathematica? I seem to be doing
> "Esc [
>>> [ Esc Esc ] ] Esc left arrow" quite a lot in a Windows 7 system.
>>>
>>> Barrie
>>>
>>>
>>
What you want is not difficult. Since you will modify a system file,
make a back-up copy.
Open the
file:
($InstallationDirectory)\SystemFiles\FrontEnd\TextResources\Windows\KeyEventTranslations.tr
Modify it to read:
.
.
.
EventTranslations[{
(* User-added keyboard commands *)
Item[KeyEvent["[", Modifiers -> {Control}],
FrontEndExecute[{
FrontEnd`NotebookWrite[FrontEnd`InputNotebook[],
"\[LeftDoubleBracket]", After]
}]],
Item[KeyEvent["]", Modifiers -> {Control}],
FrontEndExecute[{
FrontEnd`NotebookWrite[FrontEnd`InputNotebook[],
"\[RightDoubleBracket]", After]
}]],
Item[KeyEvent["]", Modifiers -> {Control, Command}],
FrontEndExecute[{
FrontEnd`NotebookWrite[FrontEnd`InputNotebook[],
"\[LeftDoubleBracket]", After],
FrontEnd`NotebookWrite[FrontEnd`InputNotebook[],
"\[RightDoubleBracket]", Before]
}]],
(* Evaluation *)
.
.
.
Where the vertical . . . represents the original lines above and below.
This adds three keyboard combinations, where "[[" and "]]" represent
the proper forms, and "_" the cursor position:
Ctrl+[ -> [[_
Ctrl+] -> ]]_
Ctrl+Alt+] -> [[_]]
If you do not use the first two, simply remove those blocks from the
file. It should be easy enough to change the keys or add other
commands once you have a look at the file.
Have a good day,
Paul
actually CA has a double left/right bracket icon....under Typsetting and the very first folder you can find a double bracket button there...
jerry blimbaum
----- Original Message -----
From: Barrie Stokes
To: math...@smc.vnet.net
Sent: Wednesday, January 19, 2011 4:30 AM
Subject: adding a keyboard shortcut for double brackets
Hi All
I note in the Help page "Keyboard Shortcut Listing" that for example entering Alt+] gives the pair of single brackets [] with the cursor between them.
No such shortcut is listed for the double brackets [[ ....]]. Can this beadded to one's installation of Mathematica? I seem to be doing "Esc [ [ Esc Esc ] ] Esc left arrow" quite a lot in a Windows 7 system.
Barrie
Item["&Something",FrontEndExecute[someCommand[]], MenuEvaluator->Automatic]
The someCommand can contain any Mathematica operations, such as
NotebookWrite[InputNotebook[],"[[]]"
];SelectionMove[InputNotebook[],Before,Character,2]
David Bailey
http://www.dbaileyconsultancy.co.uk
It looks good, but doesn't work for me. Nothing happens. Are you sure
BTW that the last keyname should be "Command" instead of Alt? Sounds
mac-speek to me.
Cheers -- Sjoerd
On Jan 22, 9:20 am, gl...@flashmail.com wrote:
> Hello Barrie,
>
> What you want is not difficult. Since you will modify a system file,
> make a back-up copy.
>
> Open the
> file:
> ($InstallationDirectory)\SystemFiles\FrontEnd\TextResources\Windows\KeyEv=
entTranslations.tr
>
> Modify it to read:
> .
> .
> .
> EventTranslations[{
>
> (* User-added keyboard commands *)
> Item[KeyEvent["[", Modifiers -> {Control}],
> FrontEndExecute[{
> FrontEnd`NotebookWrite=
[FrontEnd`InputNotebook[],
> "\[Lef=
tDoubleBracket]", After]
> }]],
> Item[KeyEvent["]", Modifiers -> {Control}],
> FrontEndExecute[{
> FrontEnd`NotebookWrite=
[FrontEnd`InputNotebook[],
> "\[Rig=
htDoubleBracket]", After]
> }]],
> Item[KeyEvent["]", Modifiers -> {Control, Command}],
> FrontEndExecute[{
> FrontEnd`NotebookWrite=
[FrontEnd`InputNotebook[],
> "\[Lef=
tDoubleBracket]", After],
> FrontEnd`NotebookWrite=
[FrontEnd`InputNotebook[],
> "\[Rig=