For interacting with the Mathematica front-end using the keyboard: shortcut keys, KeyEvents, keyboard navigation, etc.

learn more… | top users | synonyms

32
votes
2answers
1k views

Automating Esc [[ Esc formatting?

Is it possible to program the Front End to automatically format double square brackets without having to type Esc[[Esc each time? It's awful to have to type Esc ...
25
votes
2answers
741 views

Template completion

In version 8, if one evaluates test::usage="test[x,y]"; then types test, then shift-cmd-k (or shift-ctrl-k), a template ...
25
votes
1answer
994 views

Cheat sheets or reference cards for Mathematica

In order to improve my workflow with Mathematica, I'm looking for cheat sheets. The purpose of such reference cards is to be printed and to stay on the desk during the learning of a new programming ...
21
votes
3answers
924 views

Detecting KeyUp events

Is there a way to detect when a key is released, similar to EventHandler[InputField[], {"KeyDown", "k"} :> Print["k pressed"]] It seems such detection isn't ...
18
votes
1answer
925 views

How can I set a keyboard shortcut to run a command?

I want to use this to add a keyboard shortcut to an undo function I wrote. The basic problem is the following: I have a command, let's say x=1, and I want to run ...
17
votes
4answers
662 views

How can I make an InputField with a proper newline/carriage return?

The return key does not work as expected in an InputField, how can I overcome this?
16
votes
2answers
5k views

Delete the current notebook cell using the keyboard

Is there another way than pressing Ctrl+. until the whole cell is selected and then pressing Del? If this is not built in, can I create some sort of a global macro to do this and bind it to a ...
16
votes
2answers
1k views

How can I change the keyboard shortcut for switching the active window?

The default keyboard shortcut (on Windows at least) for switching focus to the next window is Ctrl+F6, and for switching to the previous windows it's Shift+Ctrl+F6. How can I change this to Ctrl+Tab ...
16
votes
1answer
618 views

Best way to add KeyEvents and faster Quit

Many users have asked how to add KeyEvents to speed/improve keyboard input. This is just a random example. The technique is always the same. It requires that you ...
15
votes
2answers
716 views

Command Completion

Note: As of version 9, this functionality is available and works out of the box. I've a few questions about Command Completion in Mathematica. I recently discovered this feature, and it's really ...
15
votes
2answers
666 views

How to write plain Greek in a text cell

If I create a text cell and type some greek text, most of the symbols are italics as if the cell had an Input style. It doesn't happen with latin characters. I recollect that it is impossible to fix ...
15
votes
3answers
793 views

Opening a context menu (with the Menu key)

Is it by any chance possible to make the Menu key work as one would expect in Mathematica: opening a context menu? The Menu key does nothing in version 7 or 8 on Windows.
15
votes
2answers
383 views

Auto-completion doesn't work as my expectation in version 9.0

When I input the following line in version 8, and press Ctrl+K after Re, I can get a drop-down auto-completion list including ...
14
votes
3answers
487 views

Defining symbol shortcuts in the Front End

I was wondering (because I could not find any documentation on this) if it is possible to do shorthand abbreviations for domains or could one define them? E.g. In[1]:= Element[p,Complexes] ...
13
votes
4answers
730 views

How to automate a FrontEnd return?

I use some custom shortcut keys in KeyEventTranslations.tr. One is for the Delete All Output function: ...
13
votes
1answer
261 views

Customize keybindings without modifying files in the installation directory

I would like to know if I can modify key bindings without being able to modify the KeyEventTranslations.tr in the installation directory. So maybe putting another one in my home dir and ...
12
votes
3answers
570 views

How to make the suggestion box appear?

When you type a function in Matlab, quickly a suggestion box comes up showing functions similar to the one you're typing. I thought that Mathematica didn't have this but one day, I typed half of a ...
11
votes
2answers
432 views

How can I overload autocompletion to work with full contexts?

I would like for the autocomplete feature to search through contexts, for example if I have a symbol named A`B`C`MyFunction, when I type A` and press "cmd + shift + k" it will complete it. Edit To ...
10
votes
2answers
473 views

Move the cursor in a notebook using the keyboard

How can I move through a notebook using only the keyboard? If one tries to use the arrow keys, the cursor tends to get "trapped" in comments and error messages.
10
votes
2answers
418 views

Get tab key to indent a block of code

Is there some way I can change Mathematica keyboard behavior so I could select a block of text/code, press tab, and the selection would be indented to right? Similarly, I would like shift+tab to ...
10
votes
0answers
439 views

How to copy hyperlink addresses using the keyboard

I would like to copy the address of a hyperlink in Mathematica using the keyboard. I found code for copying hyperlink addresses in ContextMenus.tr: ...
9
votes
3answers
683 views

Ctrl+= opens the alpha input instead of below-script

When trying to type "traditional style" inputs such as integrals or sums, I follow the tutorial and type Esc sum Esc   Ctrl+= n=1  Ctrl+% 10 whatever However, when I type Ctrl+= it opens ...
9
votes
4answers
906 views

Preventing Superscript from being interpreted as Power when using Ctrl+^ shortcut?

I have very strong desire to use superscript as the index of the variable. However, it looks like that the Mathematica automatically recognize the superscript as the power and I got message that my ...
9
votes
4answers
997 views

Create shortcut in Mathematica for “Equal Symbol Aligned Math Cell”

How do I create a new shortcut for creating a "Equal Symbol Aligned Math Cell" in Mathematica 8? Update I meant a keyboard shortcut. An "Equal Symbol Aligned Math Cell" is exactly what @Heike ...
9
votes
1answer
1k views

Rebinding keys to define new keyboard shortcuts

I've checked Mathematica → Preferences, and poked around the options on the toolbar. However, I don't see a way to define new keyboard shortcuts in Mathematica. I've used VIM for 10+ years, and I've ...
9
votes
1answer
168 views

Version 10.2, key shortcuts for matching brackets do not work?

Bug introduced in 10.2 System: Linux Once updated to 10.2, my Alt+} and Alt+) do not return a pair of brackets but a single right one, as if Alt is not pressed. Alt+] still works.
9
votes
2answers
462 views

Front end typing lag

Under Windows 7 I frequently get serious keyboard lag. My home machine (Windows XP) NEVER lags. I was able to improve things somewhat by running Mathematica as Administrator, but this only went so ...
8
votes
3answers
323 views

Select Cells to End of Notebook

I'd like to create a keyboard shortcut that will allow me to select all of the cells from the current cell until the end of the notebook, similar to how ShiftCtrlEnd functions when editing text in ...
8
votes
1answer
395 views

Enhanced “Complete Selection” (dynamic autocomplete) for Text input?

The autocomplete ("Complete Selection") feature Ctrl-K (or F2 on Windows) works fine for functions and code input. Is there a way to enhance it for text input? Today’s standard (see e.g. OpenOffice ...
8
votes
1answer
987 views

Emacs key bind on Mathematica Linux

This might not be Mathematica specific question but if there is anyone who can use Emacs keybind on Ubuntu Linux, would you share how you realize it? I'm using Mathematica student edition both on ...
8
votes
0answers
370 views

Keyboard issues with Mathematica 9.0.1 for Linux [closed]

After working for a while with Manipulate function and increasing the number of variables to be manipulated, keyboard stops working properly in the Notebook. It ...
8
votes
0answers
118 views

Esc-esc for special characters and autocomplete in Mathematica 9 [duplicate]

I recently upgraded to Mathematica 9 and have noticed a slightly annoying behavior that I was looking to remedy. In the past I would type special characters, e.g. ...
7
votes
1answer
222 views

How can I add arbitrary code into DefaultKeyTranslations.tr?

The solution to this question on how to get latex code for a text cell (which Mathematica doesn't do correctly) was formulated as a palette but I need it as a keyboard shortcut. How can I add an ...
7
votes
1answer
371 views

On a Mac OS X, Ctrl-Backspace generates ascii code 8 (backspace), which is almost invisible but very annoying

When I press Ctrl-Backspace, Mathematica inserts what looks either like a tiny white space or sometimes is invisible. Actually, though, it is an ascii character code 8, also enterable in Mathematica ...
6
votes
1answer
270 views

Remap Ctrl+Space?

The Ctrl+Space keyboard shortcut is really important in Mathematica for using Placeholder[] boxes in input templates. Unfortunately, Ctrl+Space occupies the ...
6
votes
2answers
2k views

Windows IME Chinese blocking shortcut for ctrl + space

I currently use the Windows IME on Windows Vista to allow myself to type Chinese characters (not in Mathematica), and by default typing CtrlSpace switches between the English keyboard and the Chinese ...
6
votes
2answers
216 views

Evaluating selected expression using keyboard shortcut

Imagine that in this toy code I want to evaluate just the selected (blue) expression: To get as output result: {09/14,09/15,09/16,09/17,09/18,09/19,09/20} There is some shortcut to do this? I'm ...
6
votes
1answer
414 views

The shortcut for Subsuperscript doesn't work?

The document for Subsuperscript says that: To enter a subsuperscript in a notebook, use either Ctrl+_ to begin a regular subscript or Ctrl+^ to begin a regular superscript. After typing the ...
6
votes
1answer
129 views

How to handle keyboard events for unselected item in CDF?

How can I force the keyboard input to work for this cell without clicking on it after I evaluate or showing a blinking selection cursor? This is for running CDF games in a browser. ...
6
votes
1answer
152 views

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

This counts as something of a basic question, but one for which I cannot find an answer. I checked the documentation, I checked google, I searched it here, I read a bunch of different things, but ...
6
votes
1answer
90 views

using keyboard shortcuts with non-US keyboard

There are several keyboard shortcuts that do not seem to work for me. I am using a German keyboard. I think this only happens when I have to use a modifier key that does not have to be used in case of ...
6
votes
0answers
154 views

Automatic replacing of [ with []

I tried to modify the KeyEventTranslations.tr file in order to always place a closed bracket instead of an open bracket once I press ...
5
votes
2answers
221 views

Is it possible to define more than 9 shortcuts for notebook cell styles?

You can define shortcuts for notebook cell styles in the stylesheet editor, by adding MenuCommandKey->"7", etc. to the style definition. That is, you can define ...
5
votes
1answer
286 views

Cursor Position / Insertion Point

Is there a way to access (or even set) the cursor position in a Notebook? (By Cursor I refer to the keyboard input postion, or "Insertion Point". For the Mouse we have ...
5
votes
1answer
128 views

How to move a cell up or down with a keystroke?

It is very useful during refactoring to move lines around. All popular IDEs or text editors have this feature (PyCharm, Vim, Sublime, etc..) for example in Xcode you press: ⌥⌘[ or ⌥⌘] to move lines up ...
5
votes
1answer
272 views

How to make the Menu key on my keyboard work in Mathematica

My Menu key works in Windows Explorer, Internet Explorer, many apps, but does not work in Mathematica's notebook. The function is like that of Right-Click with the mouse. Function expected: Select ...
5
votes
0answers
117 views

Simple Choice-Dialog like the auto-completion popup

What I want is pretty simple, nevertheless, after half an hour I have only unsatisfying solutions here. Let me ask you who might work more often with Mathematica's GUI elements: Is there a way to ...
5
votes
0answers
262 views

Why FrontEnd`KernelExecute doesn't work in KeyEventTranslations.tr?

Which commands can you put in KeyEventTranslations.tr ? There is an extensive list of FrontEndTokens, but what else can you use? Why something like this doesn't ...
4
votes
2answers
170 views

Capturing an F1

I teach an Intro to Mathematica course, and one of the things I try to reinforce early on is just how helpful Mathematica's help is. In the very first lab for the course, I even give the students a ...
4
votes
2answers
138 views

Headings, subheadings, text cells etc and Alt+n

This is a minor point but annoying. I have just upgraded to version 10.0.2.0 and discovered that you must select a bracket before doing Alt+1, or Alt +7 to make a cell a heading or text cell. This was ...