I want to some key combination like CtrlShift+ to insert Print[ ]; into a workbook. I used
FrontEndExecute[FrontEnd`AddMenuCommands[
"DuplicatePreviousOutput", {Delimiter, MenuItem["Print[ ];",
FrontEnd`KernelExecute[nb = SelectedNotebook[];
NotebookWrite[nb, Cell[BoxData[RowBox[{"Print[ ];"}]], "Input"]];],
MenuKey["+", Modifiers -> {"Control", {"Shift"}}],
System`MenuEvaluator -> Automatic]}]]
from this answer. It works nicely, but it adds a new item to the insert menu every time I use it. I've tried as many ways as I can think of to simplify the code, but it never works after these changes. I would rather not use the Esc string Esc approach discussed here Escape because it requires several keystrokes.
jokerfunctionality fromShortcutspackage should fit your need. Take a look on example: 34159. Is this what you need? – Kuba Nov 26 '15 at 15:40