28 votes

Is it possible to maintain user-defined shortcuts in a web-installable package?

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 ...
  • 16.9k
25 votes
Accepted

Customize keybindings without modifying files in the installation directory

You can see what can be done by running (maybe inspecting it in a browser first) Get["http://www.mertig.com/shortcuts.m"] This code will generate a modified copy ...
  • 16.9k
21 votes
Accepted

Parenthesize what I have highlighted

I have this palette open all the time: ...
16 votes

There is a button in the "basic math assistant" which wraps highlighted text in chosen brackets. Is there no keyboard command for this?

Here is the answer given by Rolf Mertig that includes many additional shortcuts. One of them Ctrl+t, evaluates whatever is stored in joker.m file (invoked by Ctrl+Shift+J). There are already two ...
  • 134k
16 votes

How can I get 'KeyDown' without writing 26 commands?

Perhaps something like this?: DynamicModule[{key = ""}, EventHandler[ Dynamic[key], {"KeyDown" :> (key = CurrentValue["EventKey"])} ]]
  • 225k
15 votes

How can I create a shortcut to convert "normal Symbol" to Formal Symbol?

Here's an attempt: ...
  • 29.9k
14 votes
Accepted

How to Detect Special Key Presses in a Notebook?

Following detects backspace on Mac: SetOptions[EvaluationNotebook[],NotebookEventActions-> {{"KeyDown","\.08"}:>Print["triggered"]}] This code can be ...
  • 6,328
13 votes
Accepted

Is there a keyboard shortcut to navigate to a matching parenthesis/bracket?

I think you're looking for the menu item Edit | Check Balance or the equivalent keyboard short-cut Shift + Cmd + B.
  • 126k
12 votes
Accepted

Cheat sheets or reference cards for Mathematica

Best Cheat Sheet so far... Pretty much the best Cheat Sheet I have come across so far, is the following one by Hugo Touchette, a theoretical Physicist teaching at the National Institute for ...
  • 12.7k
12 votes
Accepted

How to open a Python interpreter input cell?

Type > at the start of a cell (or when between cells). This is documented in an example on ref/ExternalEvaluate (last Basic Example). I'm a bit suprised it's not in the details section. It probably ...
  • 13.7k
11 votes
Accepted

Is there a keybinding for absolute value?

There isn't a built-in keybinding, but you can define one yourself: ...
  • 96k
11 votes

Is there a keybinding for absolute value?

If one does not mind occupying BracketingBar this can be done quite cleanly. ...
  • 266k
10 votes
Accepted

How to enter underscripts in 12.2?

In Mathematica 12.2 the way to enter underscripts is Ctrl+Shift+, (comma). At least on macOS.
  • 726
9 votes
Accepted

How can I create a shortcut for a command in Mathematica?

It seem to me that for a task like writing homework, it would be complete overkill to try anything fancy or low-level. So I would suggest instead to go with something like this, which just applies in ...
  • 96k
9 votes

Integrate using \[Esc] int \[Esc]

If you cannot resolve the keyboard behavior try an alternate input form; I propose: EscdinttEsc To input: Then use Tab to move between the ...
  • 266k
9 votes
Accepted

Is there any keyboard shortcut to delete the output of a particular cell

There is too much burden attached to working with KeyEvenTranslations.tr so I rarely use it. You can try an alternative: ...
  • 134k
9 votes
Accepted

Can I stop the python interpreter appearing?

The short-cut > at the beginning of a line to start an external code cell is set as part of style definitions for Input cells: ...
  • 354k
9 votes
Accepted

How can I self-define a keyboard entry for 3-dot "Because"?

You can use InputAliases to define an alias, like ...
  • 12.7k
8 votes
Accepted

Shorter shorthand for StringJoin[]?

Even though belisarius' answer is probably closest to what you want, I find that I quite often do something like this: ...
8 votes

Docked cell showing keystrokes and mouse buttons actions

Sadly, this can't be done with 100% fidelity. For example, a significant issue is that on some platforms, there is no way to directly capture keystrokes which are mapped to menu commands. The ...
  • 12.5k
7 votes

Simple Choice-Dialog like the auto-completion popup

Edit Once again b3m2a1 provided more detailed information about a FE's feature so I have to retract my claim that it is not worth an effort to create a popup on cursor position as opposed to e.g. in ...
  • 134k
7 votes

Create custom shortcut to change font color

One can change MenuItem["Red", FontColor->RGBColor[1, 0, 0]], to, e. g., ...
  • 27.3k
7 votes

Switch actions of Shift+Enter and Enter in notebook interface?

This piece of code should do the trick. It takes effect immediately. ...
  • 567
7 votes

How to Detect Special Key Presses in a Notebook?

@BlacKow's answer works well on Mac, but Mathematica cannot handle special keys (s.a. F2 or PAUSE) on Windows. Thus, Here is a Windows workaround: The idea is to create a dynamic link library that ...
  • 2,871
7 votes
Accepted

Remap escape key for entering special characters?

Quit Mathematica. Look up the file KeyEventTranslations.tr in your installation directory. Open it in any editor (but better not in the Mathematica editor). Find ...
7 votes
Accepted

How can I create a shortcut to convert "normal Symbol" to Formal Symbol?

An alternative is to create a notebook containing all the automatic replacements using InputAutoReplacements: Test:
6 votes

Best way to add KeyEvents and faster Quit

Here is a way that avoids the sometimes buggy FrontEnd`AddMenuCommands and gives us better flexibility. It's based on what I did here and here to do effectively ...
  • 46k
6 votes

Get tab key to indent a block of code

I do much the same as Leonid, except I generally first convert the \[IndentingNewLine] structure into the appropriate tabified block: ...
  • 46k
6 votes
Accepted

Switch actions of Shift+Enter and Enter in notebook interface?

First move KeyEventTranslations.tr file to your $UserBaseDirectory in order to not damage installation files. (Rebinding keys to ...
  • 134k

Only top scored, non community-wiki answers of a minimum length are eligible