Skip to content

Keyboard bindings

Rogallo allows for a degree of configuration of its keyboard bindings; providing a method for setting up replacement bindings for the commands that appear in the command palette.

Bindable commands

The following commands can have their keyboard bindings set:

  • AboutClientCertificate - Show information about the client certificate used for the current page
    • Default: shift+f7
  • AboutThisPage - Show information about the current page
    • Default: f7
  • AddLocationToBookmarks - Add the current location to the bookmarks
    • Default: ctrl+b
  • Backward - Move backward through history
    • Default: ctrl+left_square_bracket
  • BrowseTrustedHosts - Browse the list of trusted hosts
    • Default: ctrl+shift+t
  • ChangeTheme - Change the application's theme
    • Default: f9
  • ClearCache - Clear the cache for all content
    • Default: shift+f5
  • CopyDocumentToClipboard - Copy the current document to the clipboard.
    • Default: alt+shift+c
  • CopyLocationToClipboard - Copy the current location to the clipboard.
    • Default: ctrl+shift+c
  • Forward - Move forward through history
    • Default: ctrl+right_square_bracket
  • GoHome - Go to the home page
    • Default: ctrl+h
  • GoToParent - Go to the parent directory
    • Default: alt+up
  • GoToRoot - Go to the root directory
    • Default: alt+shift+up
  • HandOffToOperatingSystem - Hand off the current location to the operating system
    • Default: ctrl+shift+o
  • Help - Show help for and information about the application
    • Default: f1, ?
  • JumpToCommandLine - Jump to the command line
    • Default: /, ctrl+1
  • JumpToDocument - Jump to the document viewer
    • Default: ctrl+slash, ctrl+g, ctrl+2
  • JumpToSidePanel - Jump to the side panel
    • Default: ctrl+3
  • OpenFile - Open a file in the local filesystem
    • Default: ctrl+o
  • PipeDocument - Pipe the current document to an external command
    • Default: ctrl+shift+p
  • Quit - Quit the application
    • Default: f10, ctrl+q
  • Reload - Reload the current document
    • Default: ctrl+r, f5
  • SaveSource - Save the source of the current document to a file
    • Default: ctrl+s
  • SearchBookmarks - Search the bookmarks for a location
    • Default: f3
  • SearchHistory - Search the history for a location
    • Default: f2
  • SetHome - Set the home page to a specific location
    • Default: alt+h
  • SetHomeToCurrentLocation - Set the home page to the current location
    • Default: ctrl+shift+h
  • ToggleSidePanel - Toggle the visibility of the side panel
    • Default: ctrl+l
  • ToggleView - Toggle between rendered and source view of the document
    • Default: f4
  • ViewChangeLog - View the Rogallo ChangeLog
    • Default: ctrl+shift+l

Changing a command binding

Rogallo's default bindings for all of the above commands can be overridden using a bindings.yaml file placed in the configuration directory.

Tip

The configuration directory will be below $XDG_CONFIG_HOME, in a rogallo subdirectory. Mostly this will translate to the directory being called ~/.config/rogallo/.

If you wish to change the binding for a command, create the bindings.yaml file in the configuration directory (if it doesn't already exist), and add a line in the format:

<Command>: <Key>

where <Command> is a recognised Rogallo command and <Key> is the key to bind to it. For example, if you wanted to change the binding used to toggle the display of a page between a rendered view or a source view, changing it from f4 to ctrl+t, you would add this:

ToggleView: "ctrl+t"

The designations used for keys is based on the internal system used by Textual; as such its caveats about what works where apply. The main modifier keys to know are shift, ctrl, alt, meta, super and hyper; letter keys are their own letters; shifted letter keys are their upper-case versions; function keys are simply f1, f2, etc; symbol keys (the likes of #, @, *, etc...) generally use a name (number_sign, at, asterisk, etc...).

Tip

If you want to test and discover all of the key names and combinations that will work, you may want to install textual-dev and use the textual keys command.

If you need help with keyboard bindings please feel free to ask.

A fuller example of a custom keyboard binding file might look like:

Backward: "ctrl+h"
Forward: "ctrl+l"
ToggleView: "ctrl+t"
GoHome: "ctrl+shift+h"

User interface element bindings

Each of the main user interface elements also allows for a degree of keyboard binding override. In their cases the command that you override is in the form of <ui_element>.<action>. You can find the list of actions for each UI element in the "Available bindings" section of each of the following:

As mentioned above, if you wish to override one of these UI element actions, you set the binding as you would with an application command. For example, if you wanted to have F12 be the key to start a search in the viewer:

viewer.start_search: "f12"