Keyboard Shortcut

Category: Widgets
Subcategory: Utility

Overview

Trigger an action if a certain combination of keys is pressed. Any key can be combined with the ctrl, alt and/or shift keys.

Documentation

KeyboardShortcut

Trigger an action if a certain combination of keys is pressed

Features

  • Add one or many shortcuts that trigger an action
  • Check whether ctrl, alt and/or shift key is pressed together with the key (e.g. ctrl+c)
  • Add a loading indicator while an action is being executed

Usage

Place the widget on the page and configure the shortcuts. Make sure you use the event codes (see e.g.https://keycode.info/ and use event.code) for the key configuration and combine the key with ctrl, shift and/or alt key by marking the checkboxes if needed. If the action that the shortkey triggers needs a context object, place the widget within this dataview. Do not use the widget within a listview or templategrid. This would trigger the action for every item that is rendered.

Known limitations

When the widget is placed on a page and the page also contains a popup, the shortcuts are still triggered when the popup is opened. If this can cause issues, you must add some logic to know whether the popup is open or not and add logic to the action to skip it when needed.

Releases

Version: 1.1.0
Framework Version: 9.6.0
Release Notes: Added posibility to add a loading indicator while the action is running Fixed that textarea is seen as input
Version: 1.0.0
Framework Version: 9.6.0
Release Notes: Initial release