Skip to content

Custom Keyboard Shortcuts

Warning

Custom keyboard shortcuts are still work in progress. Everything should work as expected, but the workflow for using and configuring them is not fully worked out yet and might require some extra steps. Documentation is also lacking in some areas.

Configuring keyboard shortcuts

Any registered command can be configured to be activated with a keyboard shortcut. To add a keyboard shortcut to a command, go to the "Miscellaneous" > "Keyboard Shortcuts" section in "Lime CRM Admin" (see picture below).

The ID for the command needs to be provided along with the desired keyboard shortcut. A shortcut can be provided both for Windows and Mac OS. If the OS used by the user does not match either of them, the Windows shortcuts will be used.

When registering a key sequence just type the desired key together with any modifiers separated with +, e.g. Ctrl+Shift+U.

Keyboard Shortcuts Configuration

Modifiers

The available modifiers that can be used when configuring a keyboard shortcut are the following

  • Ctrl
  • Alt
  • Shift
  • Meta

The Meta key is the Win key on Windows and the Cmd key on Mac. Since Meta is less known of a key name, it is also possible to just specify Cmd instead, e.g. when creating a configuration for Mac. It's not possible to configure a shortcut containing only modifiers, e.g. only Alt or Ctrl+Alt is not valid.

Sequences with multiple keys

It is possible to configure a keyboard shortcut to contain multiple keys in the same sequence. If multiple keys are used they should be separated with a space in the configuration. E.g. the sequence Ctrl+U G will activate a command when the user first press Ctrl+U and then G within a short timespan. This can be used to group several related commands together. Modifiers are not limited to the first key and can be used anywhere, e.g. Ctrl+U Ctrl+G is valid.

Special key names

Since + and (space) is used as separators in the configuration, these need special handling if they are desired to be used as a keyboard shortcut. They names that should be used instead are listed in the table below

Key Key name when used in the config
Space Space
+ Plus

Note

Just because a keyboard shortcut has been configured for a custom command it does not mean that it will work automatically out of the box. If the command is part of a default action menu in the webclient (e.g. on the object card or in the table) it will automatically be bound to the configured keyboard shortcut. However, if a customization has registered a command e.g. to be handled by the click of a custom button, that command will not be registered to be handled with a keyboard shortcut as well.

In order to get this to work there are two options

  1. The customization needs to read the keyboard shortcuts configuration (webclient_keyboard_shortcuts) and use the KeybindingRegistry service to bind/unbind the configured keyboard shortcut manually.

  2. The customization needs to use either the limec-action-button or limec-action-menu components together with the command. Both components will read the config and bind/unbind the keyboard shortcuts when a component with the same context is focused or blurred.

Conventions

Even though it is possible to add almost any hotkey combinations, we still want to follow a convention for creating hotkeys for the Web Client, and expect you to do so as well, to create a consistent user experience. So here are a few rules:

  1. Hotkey chain types: We have two types of hotkey chains:

    1. Generic: hotkeys that are about high-level and generic navigation patterns, and not specific to any context. These are usually actions that user initiates from the main navigation bar (the Dock). Such hotkey chains follow this pattern: ctrl/cmd + a letter. We strongly recommend you not to use this pattern, because you are most probably not creating a high-level or core hotkey, and rather are dealing with contextual hotkeys explained below.

    2. Contextual: hotkeys that are about contextual actions, and happen deep down in views or objects, for example, when a user is viewing an object, or interacting with content of a tab. Such hotkey chains follow this pattern: ctrl/cmd + shift + a letter. Therefore, for custom hotkeys, we strongly suggest adding a hotkey chain that that follows this pattern.

  2. Windows vs. Mac: Make sure to be consistent for your choices on Windows and equivalent chain on mac. If you use ctrl + shift + X for Windows, you must use cmd + shift + X on Mac. In other words, the ctrl key is the equivalent of the cmd key on Mac OS, and not the ctrl key!

  3. Do not use alt for any hotkey chains on Mac OS. It will not work!

Avoid these hotkeys

Using some keyboard shortcuts will interfere with default hotkeys in the browser's or the operating system. In other words, they are either reserved by the system or well-known by users and expected to preform certain actions. So avoid using them. Some examples are:

  • ctrl/cmd + W : since it closes the current tab on Mac and Win
  • ctrl/cmd + B/I/S/U : since they are used for rich-text editing
  • ctrl/cmd + 1/2/.../9 : they are used to switch the active tab on Chrome, Safari, Firefox
  • ctrl/cmd + F : it's useful for finding things (buttons, table cells, etc..) on a page
  • ctrl/cmd + X/C/V : for obvious reasons
  • ctrl/cmd + A : since it selects all on a page, or in an active input box
  • ctrl/cmd + L : sets the focus on browser's URL bar
  • ctrl/cmd + T : opens a new tab on Chrome, Safari, Firefox
  • ctrl/cmd + P : opens the print wizard (maybe we can actually ignore this?)
  • ctrl/cmd + Z : undos an action
  • ctrl/cmd + Y: redos an action
  • ctrl/cmd + +/ - / 9 : zooms in or out on the page
  • cmd/cmd + R : refreshes the page
  • cmd + H : hides the active app on Mac OS
  • cmd + M : minimizes the current window to the Dock on Mac OS
  • cmd + Q : quits the browser on Mac
  • There are more like these. Make sure to read more on the topic for example here