Customising keyboard shortcuts

It isn't well known but many of Opera's keyboard shortcuts are customisable. How is this done? Let's first look at the defaults.

Linux defaults

Keybindings": {
    "Settings": { "AdvancedEnabled": false },
    "Basic": {
      "AccessKeyToggle": ["Esc+Shift"],
      "AddBlankTab": ["Ctrl+T"],
      "AddToBookmarks": ["Ctrl+D"],
      "AddToFavorites": ["Ctrl+B"],
      "Back": ["Alt+Left","Ctrl+Left"],
      "BookmarkManager": ["Ctrl+Shift+B"],
      "CloseActiveTab": ["Ctrl+W","Ctrl+F4"],
      "ClosePrivateWindow": ["Ctrl+Shift+Q"],
      "CloseWindow": ["Ctrl+Shift+W","Alt+F4"],
      "Copy": ["Ctrl+C","Ctrl+Ins"],
      "Cut": ["Ctrl+X", "Shift+Del"],
      "CycleBackwardInActivationList": ["Ctrl+F2"],
      "CycleForwardInActivationList": ["Ctrl+F1"],
      "CycleToNextTab": ["Ctrl+Tab"],
      "CycleToPreviousTab": ["Ctrl+Shift+Tab"],
      "Delete": ["Del"],
      "DevTools": ["Ctrl+Shift+I"],
      "DevToolsConsole": ["Ctrl+Shift+J"],
      "DevToolsInspect": ["Ctrl+Shift+C"],
      "EditProperties" : ["Alt+Enter"],
      "ErrorConsole": ["Ctrl+Shift+O"],
      "Exit": ["Ctrl+Q","Ctrl+Shift+X"],
      "Extension": ["Ctrl+Shift+E"],
      "Find": ["Ctrl+F"],
      "FindNext": ["Ctrl+G","F3"],
      "FindPrevious": ["Ctrl+Shift+G","Shift+F3"],
      "FitToWidth" : ["F11+Ctrl"],
      "FocusAddressbar" : ["Ctrl+L","Alt+D","Ctrl+E","F8"],
      "FocusMenuBar": ["F10"],
      "FocusNextPane": ["F6"],
      "FocusPreviousPane": ["Shift+F6"],
      "FocusNextWidget": ["Tab"],
      "FocusPage" : ["F9"],
      "ForceReload": ["Shift+F5","Ctrl+F5"],
      "Forward": ["Shift+Backspace","Alt+Right","Ctrl+Right"],
      "GoToEnd": ["End","Ctrl+End"],
      "GoToPage" : ["F2"],
      "GoToSpeedDial_1" : ["Ctrl+1"],
      "GoToSpeedDial_2" : ["Ctrl+2"],
      "GoToSpeedDial_3" : ["Ctrl+3"],
      "GoToSpeedDial_4" : ["Ctrl+4"],
      "GoToSpeedDial_5" : ["Ctrl+5"],
      "GoToSpeedDial_6" : ["Ctrl+6"],
      "GoToSpeedDial_7" : ["Ctrl+7"],
      "GoToSpeedDial_8" : ["Ctrl+8"],
      "GoToSpeedDial_9" : ["Ctrl+9"],
      "GoToTop": ["Home","Ctrl+Home"],
      "HideOpera": ["Ctrl+Shift+H"],
      "History": ["Ctrl+H", "Ctrl+Shift+8"],
      "NavFavorites" : ["Ctrl+Space", "Alt+Home"],
      "NavigateDown": ["Down"],
      "NavigateLeft": ["Left"],
      "NavigateRight": ["Right"],
      "NavigateUp": ["Up"],
      "NavStop": ["Esc"],
      "OpenDocument" : ["Ctrl+O"],
      "OpenLinkInBackground": ["Ctrl+Shift+Enter"],
      "OpenLinkInNewPage": ["Shift+Enter"],
      "OpenMenu" : ["Alt+F"],
      "OpenPrivateWindow": ["Ctrl+Shift+N"],
      "OpenWindow": ["Ctrl+N"],
      "PageDown" : ["PageDown","Space"],
      "PageLeft" : ["PageUp+Ctrl"],
      "PageRight" : ["PageDown+Ctrl"],
      "PageUp" : ["PageUp"],
      "ParentDirectory": ["Ctrl+Backspace"],
      "Paste": ["Ctrl+V", "Shift+Ins"],
      "PasteAndGo": ["Ctrl+Shift+V"],
      "PastePassword": ["Enter+Ctrl"],
      "Preferences": ["Alt+P", "Ctrl+F12"],
      "Print" : ["Ctrl+P"],
      "PrintPreview": ["Ctrl+Shift+P"],
      "QuickPreferences": ["F12"],
      "Redo": ["Ctrl+Y","Ctrl+Shift+Z"],
      "Reload": ["F5","Ctrl+R"],
      "ReloadFrame": ["Alt+F5"],
      "ReopenLastClosedTab": ["Ctrl+Shift+T"],
      "ResetZoom" :["Mul", "Ctrl+0", "Ctrl+Num0"],
      "Save" : ["Ctrl+S"],
      "SelectAll": ["Ctrl+A"],
      "SelectPreviouslyActiveTab": ["Ctrl+OemGrave"],
      "ShowContextMenu": ["Shift+F10"],
      "ShowClearBrowsingDataDialog": ["Ctrl+Shift+Del"],
      "ShowHelp" : ["F1"],
      "ShowTabMenu" : ["Ctrl+M"],
      "ToggleFullscreen": ["F11"],
      "ToggleKeyboardSelection" : ["F7"],
      "ToggleOverstrike": ["Ins"],
      "Transfers": ["Ctrl+J", "Ctrl+Shift+7"],
      "Undo": ["Ctrl+Z", "Alt+Backspace"],
      "ValidateSource": ["Ctrl+Shift+U"],
      "ViewSource": ["Ctrl+U"],
      "ZoomIn" : ["Ctrl+OemPlus", "Ctrl+Shift+OemPlus", "Shift+OemPlus", "Ctrl+Plus", "Plus", "OemPlus"],
      "ZoomOut" : ["Ctrl+OemMinus", "Ctrl+Minus", "Minus", "OemMinus"]
    },
    "Advanced": {
      "Back": ["Z"],
      "FastForward": ["Shift+X"],
      "Find": ["OemSlash","Shift+OemSlash", "Div"],
      "FindInline": ["OemPeriod","OemComma"],
      "FocusNextFrame": ["3"],
      "FocusPreviousFrame": ["Shift+3"],
      "Forward": ["X"],
      "LoadAllImages" : ["I"],
      "ResetZoom": ["6", "Num6"],
      "Rewind": ["Shift+Z"],
      "SelectNextElement" : ["D"],
      "SelectNextHeading" : ["S"],
      "SelectNextLink" : ["A"],
      "SelectPrevElement" : ["E"],
      "SelectPrevHeading" : ["W"],
      "SelectPrevLink" : ["Q"],
      "ShowAddressDropdown" : ["H"],
      "ShowImagesToggle": ["Shift+I"],
      "SwitchToLeftTab": ["1", "Num1"],
      "SwitchToRightTab": ["2", "Num2"],
      "ZoomIn": ["0", "Num0"],
      "ZoomInMore": ["8", "Num8"],
      "ZoomOut": ["9", "Num9"],
      "ZoomOutMore": ["7", "Num7"]
    },

Customising

  • Firstly locate your Preferences file (see opera://about to find the profile directory, the Preferences file is found in there).
  • Before you edit shutdown Opera, the open the Preferences file in an editor (making sure you have backed it up first!)
  • Add the new Keybindings section immediately after the first curly bracket: {

Here is an example, of how the section should be formatted. I'll remap CycleForwardInActivationList (a.k.a. Activation Order Tab Cycling) to use Ctrl+1 (thus placing it right above Ctrl+Tab):

   "Keybindings": {
      "Basic": {
         "GoToSpeedDial_1": [],
         "CycleForwardInActivationList": ["Ctrl+1"]
      }
   },

Firstly, I unmapped GoToSpeedDial (which is currently only reserved and not actually used). Now I assigns its default shortcut to CycleForwardInActivationList instead.

Note: If you mess up the JSON formatting, or enter otherwise invalid entries in the Preference file, it will be discarded. That is why it is key that you make a backup before you start doing such editing.

P.S. This post is based on a a reply I gave on the Opera forums. However, it is an important enough feature that I think it deserves its own blog entry here.

comments powered by Disqus