?
Solved

Defining and Editing Shortcuts in Mathematica

Posted on 2008-10-01
4
Medium Priority
?
706 Views
Last Modified: 2012-06-21
I always wanted to edit my own keyboard shortcuts in Mathematica to do such repetitive tasks as inserting page breaks, selecting the current cell you're working in, applying styles (such as DisplayFormula that doesn't have an alt-# shortcut), etc.  I stumbled upon two interesting files in C:\Program Files\Wolfram Research\Mathematica\6.0\SystemFiles\FrontEnd\TextResources\Windows called KeyEventTranslation.tr and MenuSetup.tr.  These files contain a large number (if not all) of where the shortcuts are coded into the program.  However, I don't know how to edit these properly!  Any slightest change will cause Mathematica not to load properly.  How would I go about:

(1) Defining a shortcut to select right away the cell that I am working in?
(2) Adding a page break shortcut?
(3) Editing style formatting shortcuts?

Thanks,
Julian
0
Comment
Question by:aznmaven
  • 2
  • 2
4 Comments
 
LVL 22

Expert Comment

by:Brian Utterback
ID: 22633046
It may be possible, but I don't think you can just edit those files. I suspect that Mathematica checks the integrity of the files before it uses them.  There are already shortcuts for style formatting. I suspect that there is already one that will do the selection you want (but I am not sure what it is so I don't know for sure). I don't see one for inserting a page break though. Have you looked here:
http://media.wolfram.com/brochures/mathematicashortcuts.pdf.
0
 

Author Comment

by:aznmaven
ID: 22634162
yes absolutely
I checked all the existing shortcuts, but I want to create/customize my own.... I've heard its possible if you edit the files properly.
0
 
LVL 22

Assisted Solution

by:Brian Utterback
Brian Utterback earned 400 total points
ID: 22634351
Okay, assuming that it can be done (and looking around, it appears that you are right, it can), I suggest that you start small. Pick one function and remap it to a different key. If that works, then try adding a new mapping in KeyEventTranslations.tr. Just work your way up to what you want.
0
 

Accepted Solution

by:
aznmaven earned 0 total points
ID: 22865019
I've found the solution after a long time spent mucking around the keyeventtranslation.tr and menusetup.tr files... to anyone still searching for an answer out there check http://www.mathematica-users.org/webMathematica/wiki/wiki.jsp?pageName=Main_Page

lookup anything about keyboard shortcuts and you'll get an idea of what to do (its as simple as splicing in MenuKey["character",Modifiers->{whatever you want}] after the command that you want).  Be careful about syntax though, as one character out of place will cause Mathematica to crash!

Attached are my modified KeyEventTranslation.tr and MenuSetup.tr files (change extensions from txt to tr).  My mods in keyeventtranslation are obvious, but in menusetup check PageBreak, and the Table/Matrix commands.
mathematicastuff.zip
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
Steps to fix “Unable to mount database. (hr=0x80004005, ec=1108)”.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Six Sigma Control Plans

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question