docs/md/Customizing-keyboard-shortcuts.md
Available in version 3.4 or later.
You can add new keyboard shortcuts or re-assign existing shortcut to a different command.
To customize keyboard shortcuts:
Settings / Advanced Options... menu (or Ctrl + K Command Palette, type adv to narrow down and select Advanced Options... command)Shortcuts array and add new shortcut definitionsAn example of customization:
Shortcuts [
[
Cmd = CmdOpen
Key = Alt + o
]
[
Cmd = CmdNone
Key = q
]
[
Name = Create green highlight
Cmd = CmdCreateAnnotHighlight #00ff00 openedit
Key = a
]
[
Cmd = CmdNextTab
ToolbarText = Next Tab
]
]
Explanation:
Ctrl + O shortcut for CmdOpen (open a file) command. This changes the shortcut to Alt + oq closes the document. By binding it to CmdNone we can disable a built-in shortcutCmdCreateAnnotHighlight takes a color argument (#00ff00 is green) and boolean openedit argument. We re-assign a to create a highlight annotation with green color (different from default yellow) and to open annotations edit window (openedit boolean argument)Name is optional. If given, the command will show up in command palette (Ctrl + K)Key section:a, Z, 5) i.e. letters a to z, A to Z, and numbers 0 to 9Shift, Alt, Ctrl e.g. Alt + F1, Ctrl + Shift + YAlt + F3)
F1 - F24numpad0 - numpad9 : 0 to 9 but on a numerical keyboardDelete, Backspace, Insert, Home, End, EscapeLeft, Right, Up, Down for arrow keysa and A are differentShift to select upper-case i.e. Alt + a is the same as Alt + A , use Alt + Shift + A to select the upper-case AYou can see a full list of commands (or in the source code)
The changes are applied right after you save settings file so that you can test changes without restarting SumatraPDF.
If a custom Shortcut doesn't work it could be caused by invalid command name or invalid command arguments.
We log information about unsuccessful parsing of a shortcut so check the logs if things don't work as expected.