Solved

Defining and Editing Shortcuts in Mathematica

Posted on 2008-10-01
4
665 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Healthcare organizations in the United States must adhere to the guidance of both the HIPAA (Health Insurance Portability and Accountability Act) and HITECH (Health Information Technology for Economic and Clinical Health Act) for securing and protec…
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Using Adobe Premiere Pro, the viewer will learn how to set up a sequence with proper settings, importing pictures, rendering, and exporting the finished product.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

815 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

13 Experts available now in Live!

Get 1:1 Help Now