30

There are various posts here on this site about how to add user defined extra keyboard shortcuts for the front end.

The problem is how to put them into a better maintable and properly documented kernel package. Also the issue of installing and uninstalling the package should be dealt with.

So, the question is whether it is possible to construct such a package and has it been done already?

Rolf Mertig
  • 17,172
  • 1
  • 45
  • 76

1 Answers1

29

Original answer

Yes, with a bit of effort it is possible to construct such a package. My package Shortcuts, inspired by various questions and answers on this site over the years, can be installed in less than a minute from within a fresh notebook in Mathematica 9 or 10, on Windows, MacOSX or Linux by this

Get@"http://goo.gl/aAxplX"

or

Get@"http://www.mertig.com/shortcuts.m"

Note that during installation some dialogs will pop up, which I think should be always confirmed, though if you are very afraid of evaluating Dynamic content in notebooks from others, you might not want to confirm them (though then the shortcuts often trigger an "Enable Dynamics" question in notebooks saved in "insecure" locations).

All code is available on Github here.

I found Windows the most friendly operating system to add user keyboard shortcuts to.

Screen shots of the shortcut listings are:

  • Windows: Windows shortcuts
  • MacOSX: MacOSX shortcuts
  • Linux: enter image description here

The package Shortcuts` gets installed in $UserBaseDirectory/Applications and is loaded automatically when using a keyboard shortcut. The package is documented in the Wolfram Documentation center. If you want to get rid of the shortcuts just do:

Needs["Shortcuts`"];
UninstallShortcuts[];

which deletes the generated KeyEventTranslations.tr file $UserBaseDirectory.

Kuba
  • 136,707
  • 13
  • 279
  • 740
Rolf Mertig
  • 17,172
  • 1
  • 45
  • 76