MathGroup Archive 2000

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Keyboard shortcuts

Mr. Sharma kindly answered my question today via email. I attach 
his answer below since it might be helpful for other users of 



Some time ago, Paul Hinton of WRI was kind enough to forward a recipe
remapping the keyboard. I enclose it here:

A. Sharma
Atul Sharma MD, FRCP(C)
Pediatric Nephrologist,
McGill University/Montreal Children's Hospital

Under Mathematica 3.0 and 4, keystroke sequences are associated with
actions by way of a Mathematica text resource file named

The file is installed deep within the core Mathematica tree in the

ToFileName[{$TopDirectory, "SystemFiles", "FrontEnd", "TextResources"}]

because Microsoft Windows uses different keymapping conventions, a
platform-specific version of this file can be found in:

ToFileName[{$TopDirectory, "SystemFiles", "FrontEnd", "TextResources",

The structure of the file looks something like this:

[begin file schematic]
@@resource KeyEventTranslations

EventTranslations[<list of Item[] expressions>]
[end file schematic]

An individual Item[] expression contains two arguments.

Item[KeyEvent[<event name>], <front end action>]

The argument to KeyEvent[] is a key name.  Alphanumeric keys are
represented as strings.  Function and motion keys are referred to by
symbols that usually parallel their labeled name.  For example, the act
typing the K key by itself is represented as


However, a key such as the right arrow cursor movement key will look


Most of the non-alphanumeric keys are associated with events in, so it is probably no necessary for you to guess
at the key's name.

KeyEvent[] expressions support two options.

Modifiers, which takes a list of modifier key names as its value.  These
are keys that must also be depressed with the primary key to acutate the
event.  For example, to denote Ctrl-I, you could enter the following:

KeyEvent["i", Modifiers -> {Control}]

Modifier key names are Shift, Control, Command, and Option.  On a
Macintosh, these map to keys with the same name.  Under X Window,
maps to Mod1 and Option maps to Mod2.  On Microsoft Windows, Command
to the Alt key, and the Control key maps to itself.

If you want an action to take place only within a cell that uses
two-dimensional boxes (StandardForm or TraditionalForm), then you can
an option named CellClass and give it the value BoxFormData.  In this
example, pressing Ctrl-Left Arrow will apply only in cells which use
StandardForm or TraditionalForm.  It will not apply to plain text cells

  • Prev by Date: Re: breaking up lists into intervals
  • Next by Date: Re: breaking up lists into intervals
  • Previous by thread: Keyboard shortcuts
  • Next by thread: Re: Keyboard shortcuts