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

learn more… | top users | synonyms

30
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 ...
12
votes
4answers
598 views

How to automate a FrontEnd return?

I use some custom shortcut keys in KeyEventTranslations.tr. One is for the Delete All Output function: ...
17
votes
4answers
534 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
912 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
507 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 ...
16
votes
2answers
3k 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 ...
14
votes
2answers
434 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] ...
18
votes
1answer
699 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 ...
25
votes
2answers
681 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 ...
6
votes
1answer
90 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 ...
11
votes
2answers
410 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 ...
15
votes
3answers
751 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.
9
votes
4answers
878 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 ...
15
votes
2answers
503 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 ...
6
votes
2answers
185 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 ...
4
votes
2answers
159 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 ...
3
votes
2answers
208 views

Key to get help about current function

I know you can hit F1 to pop up the documentation center, and then type the name of a function and search for it. I'd like to know if there's a key that just pops up the help page of the function ...
3
votes
1answer
214 views

Autocomplete short symbol names in non-global context

Is it possible in v9 to autocomplete the short symbol names when one is operating in a context other than Global`? I.e. after evaluating the following: ...
8
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 ...
7
votes
1answer
214 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 ...
20
votes
3answers
740 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 ...
10
votes
2answers
298 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 ...
15
votes
2answers
620 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 ...
8
votes
1answer
380 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
881 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 ...
9
votes
3answers
568 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 ...
8
votes
0answers
113 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. ...
5
votes
2answers
205 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 ...
3
votes
1answer
96 views

Is it possible to get AltGr key to work in Math.exe?

For some reason when you run Math.exe form windows command line, Mathematica disables the AltGr key. This is a bit annoying since my keyboard locale has the keys [, ], {, }, @, $, \, | located under ...
3
votes
1answer
458 views

Custom setting of HOME and END keys on mac

Is there a way to set the HOME and END keys on a Mac's keyboard to jump the cursor to the line's beginning and end respectively? ...
2
votes
1answer
147 views

Wrapping at evaluation for inline cell

I've been playing with inline evaluation and I've came to the conclusion that it's most convenient to put the Dynamic@ inside the inline cell, so I've started to ...