Solved

Defining and Editing Shortcuts in Mathematica

Posted on 2008-10-01
4
655 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
Lithium-ion batteries area cornerstone of today's portable electronic devices, and even though they are relied upon heavily, their chemistry and origin are not of common knowledge. This article is about a device on which every smartphone, laptop, an…
The viewer will learn common shortcuts with easy ways to remember them. The viewer will then learn where to find all of the keyboard shortcuts, how to create/change them, and how to speed up their workflow.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now