Re: Redefine <Shift><Enter> ??
- To: mathgroup at smc.vnet.net
- Subject: [mg27726] Re: [mg27708] Redefine <Shift><Enter> ??
- From: "P.J. Hinton" <paulh at wolfram.com>
- Date: Tue, 13 Mar 2001 03:52:44 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
On Mon, 12 Mar 2001, J.R. Chaffer wrote: > On a normal desktop keyboard, the necessity to use the <Shift><Enter> > combination every time one executes a command in Mathematica is > perhaps less annoying. This is because one can just use the 'extra' > <Enter> key at the lower right of most full size keyboards, which > somehow incorporates the <Shift><Enter> functionality. > > On my laptop, however, this is not possible, because there is no extra > "Enter" key. One is forced to use the two-key combination, an added > irritation each time. > > My question is, is there a way to 'redefine' the keys in Mathematica > (or in win98, which I use) to render this a single-keypress operation > ? I have several Win98 books (including 'Mother..') but the subject > of redefining keys is characteristically ignored. The discussion that follows is independent of platform. Mathematica interprets the keystroke combination Shift-Enter as a command token named "EvaluateCells". If you want to specify an alternative keystroke, you will need to edit the corresponding Item[] entry in the resource file KeyEventTranslations.tr. 1) First determine the location of this resource file on your system by evaluating this expression in a notebook: LinkWrite[ $ParentLink, FrontEnd`ToFileName[ FrontEnd`FileName[ {$TopDirectory, "SystemFiles", "FrontEnd", "TextResources"}, "KeyEventTranslations.tr" ] ] ]; LinkRead[$ParentLink] If you are working with a shared installation, you may not have permissions to edit this file. If that is the case, copy the resource file to a new directory with path: LinkWrite[ $ParentLink, FrontEnd`ToFileName[ FrontEnd`FileName[ {$PreferencesDirectory, "SystemFiles", "FrontEnd", "TextResources"} ] ] ]; LinkRead[$ParentLink] 2) Open this file in your favorite text editor program and locate the line: Item[KeyEvent["Return", Modifiers -> {Shift}], "EvaluateCells"] 3) Change the argument of KeyEvent[] to whatever keystroke you wish to use. Refer to the other entries in the file to get an idea of what the syntax is like. 4) Save your changes and exit the editor. When you restart the front end, the new keystroke should be in effect. -- P.J. Hinton User Interface Programmer paulh at wolfram.com Wolfram Research, Inc. Disclaimer: Opinions expressed herein are those of the author alone.