Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Mathematica 8: Shortcut Ctrl+Tab for switching between notebooks?

181 views
Skip to first unread message

Martin Harborth

unread,
Apr 22, 2011, 5:41:22 AM4/22/11
to
Dear Mathematica Gurus,

I'm using Mathematica 8 and I was searching today in the
Internet but I did not find a solution for the following
"problem":

I really don't like the unhandy shortcut Ctrl+F6 for switching
between open notebooks. Because on a Windows system I'm used
to the convenient shortcut Ctrl+Tab for the same functionality
in a lot of different applications.

Is it really not possible to customize Mathematica key
bindings in order to have the same shortcut in Mathematica 8?

Best regards,
Martin.

István Zachar

unread,
Apr 24, 2011, 8:26:01 AM4/24/11
to
Dear Martin,

as far as I know, there is no handy way to reassign a shortcut key
combination to window swtiching *inside* Mathematica.
However, it is possible to use external applications, that register
clicks and key hits, and call arbitrary functions: one particularly
fitting is AutoHotkey:

http://www.autohotkey.com/

My personal solution is to assign the Win+Tab key to send Ctrl+F6 to
Mathematica (and change between Mathematica windows), and by this way,
I can rely on Alt+Tab as well to change between other windows and
Mathematica.
The AutoHotkey language is easy like hell, but since this is a
Mathematica forum, I won't flood it with example code. Email me if you
need further help.

Istvan

Martin Harborth

unread,
Apr 25, 2011, 7:28:17 AM4/25/11
to
Dear István,

Thanks for your suggestion to use autohotkey. But I'm using
Mathematica at my business site and I'm not allowed to install
any other "not confirmed" software on my business computer
(this is even controlled by automatic registry scan).

If there is really no way to assign Ctrl+Tab for notebook
switching within Mathematica 8 I'm still pretty astonished
because Ctrl+F6 is not handy in my opinion. And switching
notebooks is a very frequent task ...

And by the way, in Mathematica 4 on Windows, Ctrl+Tab works
like expected. So why not in Mathematica 8? :-(

Best regards,
Martin.

-------- Original-Nachricht --------
Betreff: Re: Mathematica 8: Shortcut Ctrl+Tab for switching
between notebooks?
Von: István Zachar <z...@freemail.hu>
An:
Datum: 24.04.2011 14:26

Martin Harborth

unread,
Apr 28, 2011, 6:33:55 AM4/28/11
to
Dear István,

I tried it today again.

One only has to add the following lines to the
"KeyEventTranslations.tr" file in order to have the Ctrl+Tab
key working in the front end of Mathematica 8 as in Mathematica 4:

Item[KeyEvent["Tab", Modifiers -> {Control}],
FrontEndExecute[FrontEndToken["CycleNotebooksForward"]]]

But this is really undocumented by Wolfram Research, I wonder
why ...

Thanks a lot.

Best regards,
Martin.

-------- Original-Nachricht --------
Betreff: Re: Mathematica 8: Shortcut Ctrl+Tab for switching
between notebooks?
Von: István Zachar <z...@freemail.hu>
An:
Datum: 24.04.2011 14:26

> Dear Martin,

István Zachar

unread,
Apr 30, 2011, 5:54:20 AM4/30/11
to
Thanks for the follow-up post Martin.
I was aware of the KeyEventTranslations.tr file, but it always seemed
to be a bad idea to hack it, not because of the risk (I guess it's
minimal) but because one always forget to salvage old .tr files when
moving to a new computer/new Mathematica version. For my experience,
an external script is more portable.
Also, undocumentedness is a major hindrance...

Istvan

On Apr 28, 12:33 pm, Martin Harborth <martin.harbo...@yahoo.de> wrote:
> Dear Istv=E1n,


>
> I tried it today again.
>
> One only has to add the following lines to the
> "KeyEventTranslations.tr" file in order to have the Ctrl+Tab
> key working in the front end of Mathematica 8 as in Mathematica 4:
>
> Item[KeyEvent["Tab", Modifiers -> {Control}],
> FrontEndExecute[FrontEndToken["CycleNotebooksForward"]]]
>
> But this is really undocumented by Wolfram Research, I wonder
> why ...
>
> Thanks a lot.
>
> Best regards,
> Martin.
>
> -------- Original-Nachricht --------
> Betreff: Re: Mathematica 8: Shortcut Ctrl+Tab for switching
> between notebooks?

> Von: Istv=E1n Zachar <z...@freemail.hu>

magma

unread,
May 4, 2011, 6:35:29 AM5/4/11
to
On Apr 30, 11:54 am, Istv=E1n Zachar <z...@freemail.hu> wrote:
>For my experience,
> an external script is more portable.

Why not an " internal" script? :-)
You could write a simple Mathematica function which modifies (a copy of) the
Key events binding file.

Once you have Mathematica, you do not need anything else.

Stefan Salanski

unread,
May 4, 2011, 7:48:01 PM5/4/11
to
On Apr 28, 6:33 am, Martin Harborth <martin.harbo...@yahoo.de> wrote:
> Dear Istv=E1n,

>
> I tried it today again.
>
> One only has to add the following lines to the
> "KeyEventTranslations.tr" file in order to have the Ctrl+Tab
> key working in the front end of Mathematica 8 as in Mathematica 4:
>
> Item[KeyEvent["Tab", Modifiers -> {Control}],
> FrontEndExecute[FrontEndToken["CycleNotebooksForward"]]]
>
> But this is really undocumented by Wolfram Research, I wonder
> why ...
>
> Thanks a lot.
>
> Best regards,
> Martin.
>
> -------- Original-Nachricht --------
> Betreff: Re: Mathematica 8: Shortcut Ctrl+Tab for switching
> between notebooks?
> Von: Istv=E1n Zachar <z...@freemail.hu>

Martin,
Thanks for posting that, I had no idea those files existed in an
editable format, and in Mathematica style code too!
I tried to implement what you said by placing that line into my
KeyEventTranslations.tr file, but with no effect. I have of course
restarted mathematica, though not my computer entirely. Do you have
any ideas why this is not working? The lack of documentation for this
is indeed frustrating. My system information is below if it helps.
{"8.0 for Microsoft Windows (64-bit) (February 23, 2011)", "8.0.1.0 \
(2063988, 2063803)"}
Thanks,
-Stefan S

TrinhDao

unread,
May 19, 2011, 7:42:23 AM5/19/11
to
It works for me, thanks.

Ctrl - Tab is a really good idea to change the nootbook window. (as in
Firefox, IE,...).
Just add this command and add a comma at the end.

Item[KeyEvent["Tab", Modifiers -> {Control}],

FrontEndExecute[FrontEndToken["CycleNotebooksForward"]]],

0 new messages