# How to modify the file “KeyEventTranslations.tr” to use Enter to evaluate the current cell? [duplicate]

I asked the following question before, but I do not think it has been fully answered.

By default, we use Shift+Enter to evaluate the current cell, and use Enter to get a new line. Is there a way to switch the two, i.e., use Enter to evaluate the current cell, and use Shift+Enter to get a new line (like in Maple)?

The answer is related to modifying the file "KeyEventTranslations.tr," part of which is

(* Evaluation *)
Item[KeyEvent["Enter"], "EvaluateCells"],
Item[KeyEvent["Return", Modifiers -> {Shift}], "HandleShiftReturn"],
Item[KeyEvent["Enter", Modifiers -> {Shift}], "EvaluateNextCell"],
Item[KeyEvent["Return", Modifiers -> {Shift, Control}], Evaluate[All]],
Item[KeyEvent["Return", Modifiers -> {Option}], "SimilarCellBelow"],
Item[KeyEvent["Escape"], "ShortNameDelimiter"],


I tried many different ways to modify this file, but I never succeeded. I have many confusions about this file.

1. The first item above is Item[KeyEvent["Enter"], "EvaluateCells"]. It seems that Enter is already used to evaluate cells, but it is not. I tried to modify this line as Item[KeyEvent["Enter"], "EvaluateNextCell"], Item[KeyEvent["Return"], "EvaluateCells"], and Item[KeyEvent["Return"], "EvaluateNextCell"], but in any case, Enter cannot evaluate the cell. (I am using a Windows laptop computer)

2. If I switch EvaluateNextCell and Linebreak in Item[KeyEvent["Enter", Modifiers -> {Shift}], "EvaluateNextCell"] and Item[KeyEvent["Return"], "Linebreak"] (according to Jacob's answer), then both Shift+Enter and Enter are for a line break.

3. What is difference between EvaluateCells and EvaluateNextCell? What does HandleShiftReturn mean? In a Windows laptop, does Return play a role?

4. According to the link given by Szabolcs, we can evaluate the following in a notebook.

SetOptions[EvaluationNotebook[], NotebookEventActions ->
{"ReturnKeyDown" :>
FrontEndTokenExecute["EvaluateCells"],

• SystemOpen@First@FileNames["KeyEventTranslations.tr", $InstallationDirectory, 8], items Item[KeyEvent["Enter", Modifiers -> {Shift}], "EvaluateNextCell"] and Item[KeyEvent["Return"], "Linebreak"]. Make a backup! – Jacob Akkerboom Mar 17 '14 at 20:11 • On OS X, [Return] inserts a newline and [Enter], which is different key, produces evaluation. – m_goldberg Mar 17 '14 at 22:09 • If you evaluate a cell, the cursor ismoved between the cells. And if there is another cell it will not be evaluated by "evaluateCells" but by "EvaluateNextCell" will. – Kuba Mar 28 '14 at 11:10 • @renphysics, Regarding your flag, your update only mentions Szabolcs's link. I'll try to address the questions you ask in it: 1) It works only for that notebook because it explicitly sets it only for the EvaluationNotebook[]. You can set it for all notebooks by changing that to $FrontEnd 2) These settings are stored in the object's options and persists across sessions. See Options@EvaluationNotebook[]. – rm -rf Mar 28 '14 at 19:49