15 votes

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

Perhaps something like this?: DynamicModule[{key = ""}, EventHandler[ Dynamic[key], {"KeyDown" :> (key = CurrentValue["EventKey"])} ]]
Michael E2's user avatar
  • 235k
15 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.
Carl Woll's user avatar
  • 131k
15 votes

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

Here's an attempt: ...
Lukas Lang's user avatar
  • 33.8k
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 ...
BlacKow's user avatar
  • 6,428
13 votes
Accepted

Turn off keyboard shortcut

Surprisingly, this behavior is not actually a keyboard shortcut as such. It's a style property for Input cells. To disable it, go to the menu ...
Sjoerd Smit's user avatar
  • 23.3k
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 ...
gwr's user avatar
  • 13.5k
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 ...
Itai Seggev's user avatar
  • 14.1k
11 votes

Is there a keybinding for absolute value?

If one does not mind occupying BracketingBar this can be done quite cleanly. ...
Mr.Wizard's user avatar
  • 271k
11 votes
Accepted

Is there a keybinding for absolute value?

There isn't a built-in keybinding, but you can define one yourself: ...
Jens's user avatar
  • 97.2k
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.
Philipp's user avatar
  • 726
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: ...
kglr's user avatar
  • 394k
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's user avatar
  • 137k
9 votes
Accepted

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

You can use InputAliases to define an alias, like ...
Carl Lange's user avatar
  • 13.1k
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!
Murta's user avatar
  • 26.2k
8 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:
E. Chan-López's user avatar
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's user avatar
  • 137k
7 votes

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

This piece of code should do the trick. It takes effect immediately. ...
btwiuse's user avatar
  • 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 ...
JEM_Mosig's user avatar
  • 3,003
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 ...
Henrik Schumacher's user avatar
7 votes
Accepted

All the group formatting available in Mathematica

The option StyleKeyMapping controls "Tab" and "Backspace" does to the style (AFAIK, it is ...
kglr's user avatar
  • 394k
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 ...
dzejkob's user avatar
  • 501
7 votes

Can't exit full view

Google "Mathematica full screen shortcut" Go to the first link On Windows and Unix/Linux, use F12 to toggle Full Screen. On Mac OS X, the keyboard shortcut is cmd-opt-f.
rhermans's user avatar
  • 36.5k
7 votes

Turn off keyboard shortcut

Some extra tips to anyone in my position (including future me): I was unable to make any edits to Default.nb (or any style file at all) using Mathematica's own "Edit Stylesheet" functions. ...
user297024's user avatar
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: ...
b3m2a1's user avatar
  • 46.9k
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 ...
b3m2a1's user avatar
  • 46.9k
6 votes
Accepted

keyboard shortcut to invoke Insert new matrix

In the MenuSetup.tr (for linux located in the $InstallationDirectory/SystemFiles/FrontEnd/TextResources/X/ directory), I changed the line MenuItem["&New......
Jason B.'s user avatar
  • 68.2k
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 ...
Conor's user avatar
  • 7,439
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's user avatar
  • 137k
6 votes

How to use user defined keys for navigating in Slideshows?

Evaluate one line once inside the notebook (or creating a button) will do: ...
Rolf Mertig's user avatar
  • 17.2k

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