?
Solved

Defining and Editing Shortcuts in Mathematica

Posted on 2008-10-01
4
Medium Priority
?
698 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

This article was originally published on Monitis Blog, you can check it here . If you have responsibility for software in production, I bet you’d like to know more about it. I don’t mean that you’d like an extra peek into the bowels of the sourc…
If you're a modern-day technology professional, you may be wondering if certifications are really necessary. They are. Here's why.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

752 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