# Custom keyboard shortcut. Previous answer is not working in Mathematica 10

I want to remap the alias delimiter from Esc to Ctrl+f (or Ctrl+Shift+f or some other key combo). I have not been able to get the previous solution to the question to work (Rebinding keys to define new keyboard shortcuts).

I copied the file, copy and pasted the code (though I changed it to Control, Shift [1]) into the copied KeyEventsTranslation.tr and placed the copy in my directory (full path: \$UserBaseDirectory\SystemFiles\FrontEnd\TextResources\Windows\KeyEventTranslations.tr). I restarted Mathematica and when I hit Ctrl+Shift+f nothing happens. The Escape key still produces the alias delimiter.

I have also tried changing the "Up" key to move to the next line instead of the previous line (i.e. Item[KeyEvent["Up"], "MoveNextLine"]). That does not work either. Pushing the up arrow still moves the cursor to the previous line.

Any help is appreciated.
Thanks.

OS = Windows 10 Pro 64-bit (fully patched)
Mathematica = 10.3.1.0

[1]

Item[KeyEvent["f", Modifiers -> {Control, Shift}],
FrontEndExecute[{
FrontEndNotebookWrite[FrontEndInputNotebook[],
"\[AliasDelimiter]", After]
}]],

• Did you try to put it at the end of KeyEventTranslations.tr? – Michal Jul 21 '16 at 20:09
• It seems f is the problem. x works well, I don't know why some keys are not working with Ctrl+Shift even though they are not taken. – Kuba Jul 22 '16 at 5:26

Note that both MenuSetup.tr and KeyEventTranslations.tr define keyboard shortcuts, and when a keyboard shortcut is defined in both files, the one in MenuSetup.tr takes precedence. Sometimes the keyboard short cut in MenuSetup.tr is defined, but not active, and in those situations the identical keyboard short cut in KeyEventTranslations.tr will work. So, let's find the keyboard shortcuts defined in MenuSetup.tr:

SystemMenuKey;
Cases[
Get @ FrontEndExecute @ FrontEndFindFileOnPath[
"PrivatePathsTextResources"
],
SystemMenuKey[Alternatives @@ CharacterRange["A","z"], _],
Infinity
] //Sort //Column

MenuKey["a",Modifiers->{"Command"}]

As you can see, there is already a keyboard short cut for MenuKey["F", Modifiers -> {"Control", "Shift"}], and this short cut is active in the menu system, so it prevents the version in KeyEventTranslations.tr from working.
As for the "Up" key question, the only thing I can think of is that you have two definitions for the KeyEvent`, and your new definition was overridden by the later definition.