Is there a way to set the tab key to simply insert the tab character in a notebook? I often find the sometimes mysterious "features" bound to that key detrimental.
Asked
Active
Viewed 304 times
1 Answers
6
You can try (for a single notebook)
CreateDocument[{},
NotebookEventActions -> {{"KeyDown", "\t"} :>
NotebookWrite[SelectedNotebook[], "\t"]}]
or (for global application)
SetOptions[$FrontEnd,
FrontEndEventActions -> {{"KeyDown", "\t"} :>
NotebookWrite[SelectedNotebook[], "\t"]}]
Does this meet your needs? For me it had an effect in Input cells but didn't block autocomplete behavior, though if that's what's getting in your way it can be disabled in Preferences.
mfvonh
- 8,460
- 27
- 42
EventHandler. If you are interested in mapping special keys (e.g. tab) you'll need to refer to them either using regex formats ("\t","\n",etc.) or in Mathematica-ese (see "Structural Elements and Keyboard Characters") – mfvonh May 27 '14 at 01:57