MathGroup Archive 2000

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

Search the Archive

Re: Keyboard shortcuts

  • To: mathgroup at smc.vnet.net
  • Subject: [mg23098] Re: Keyboard shortcuts
  • From: "Felix E. Klee" <felix.klee at inka.de>
  • Date: Sun, 16 Apr 2000 00:37:37 -0400 (EDT)
  • References: <8d96sb$ii3@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

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

Felix


----------------------------------------------------------------------------

Some time ago, Paul Hinton of WRI was kind enough to forward a recipe
for
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
KeyEventTranslations.tr.

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

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",
  "Windows"}]

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
of
typing the K key by itself is represented as

KeyEvent["k"]

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

KeyEvent[Right]

Most of the non-alphanumeric keys are associated with events in
KeyEventTranslations.tr, 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,
Command
maps to Mod1 and Option maps to Mod2.  On Microsoft Windows, Command
maps
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
add
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
or
InputForm.


  • 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