Solved

Defining and Editing Shortcuts in Mathematica

Posted on 2008-10-01
4
668 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:blu
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:blu
blu earned 100 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

830 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