15
votes
How can I get 'KeyDown' without writing 26 commands?
Perhaps something like this?:
DynamicModule[{key = ""},
EventHandler[
Dynamic[key],
{"KeyDown" :> (key = CurrentValue["EventKey"])}
]]
15
votes
How can I create a shortcut to convert "normal Symbol" to Formal Symbol?
Here's an attempt:
...
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 ...
14
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.
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
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 ...
11
votes
Accepted
Is there a keybinding for absolute value?
There isn't a built-in keybinding, but you can define one yourself:
...
11
votes
Is there a keybinding for absolute value?
If one does not mind occupying BracketingBar this can be done quite cleanly.
...
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.
10
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:
...
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: ...

Kuba♦
- 136k
9
votes
Accepted
How can I self-define a keyboard entry for 3-dot "Because"?
You can use InputAliases to define an alias, like ...
8
votes
Accepted
Get tab key to indent a block of code
Later is better then never. 8 years after my original question, now in version 13.1 we have tab and shift + tab indentation in a native way, with no gambiarra needed. Cool!
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 ...
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 ...

Kuba♦
- 136k
7
votes
Create custom shortcut to change font color
One can change
MenuItem["Red", FontColor->RGBColor[1, 0, 0]],
to, e. g.,
...
7
votes
Switch actions of Shift+Enter and Enter in notebook interface?
This piece of code should do the trick. It takes effect immediately.
...
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 ...
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
All the group formatting available in Mathematica
The option StyleKeyMapping controls "Tab" and "Backspace" does to the style (AFAIK, it is ...
7
votes
Strange behaviour of "Ctrl+." (ExpandSelection)
Solved it. In case someone runs into the same issue in the future, I'll describe here what I've done.
By typing Ctrl+. in Gedit, I found out this shortcut launches ...
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
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:
...
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 ...
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 ...

Kuba♦
- 136k
6
votes
6
votes
Accepted
Version 10.2, key shortcuts for matching brackets do not work?
If you add this to your KeyEventTranslations.tr file it works on Linux (I only tested english keyboard layout):
...
6
votes
hotkey to mark the current cell and make it a text cell
Wolfram Research has "sort of" fixed this annoyance in Mathematica 10.3:
If you start typing a Machine Learning algorithm running in the front end detects that you are writing text and offers you ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
keyboard × 267front-end × 96
customization × 43
notebooks × 25
linux × 15
formatting × 11
cells × 11
input × 11
autocomplete × 11
evaluation × 9
mac-os-x × 8
eventhandler × 8
dynamic × 6
windows × 6
bugs × 5
interface × 5
syntax × 4
style × 4
documentation × 4
symbols × 4
menu × 4
text × 3
kernel × 3
stylesheet × 3
fonts × 3