Class ShortcutManager

The shortcut manager. This class is responsible for dispatching and managing all registered shortcut bindings.

TODO write better docs

Constructors

Accessors

  • get rootContext(): ShortcutContext
  • The root context. All shortcut actions should be registered to this context or as a child context of the root context.

    Returns ShortcutContext

Methods

  • Removes a binding from the current profile. This will update the profile as well as all active bindings of the shortcut.

    Parameters

    • identifier: string

    Returns void

  • Finds an action by it's path. The path is defined as a sequence of context names separated by "/" followed by an action name as the last element.

    Parameters

    • path: string

    Returns ShortcutActionBase

  • Finds the action that would be triggered if the given shortcutKey was pressed at this moment.

    Parameters

    • shortcutKey: Immutable<ShortcutKey>

      The shortcut key to find the action for.

    • OptionalisActiveContextRequired: boolean

      Whether the context is required to be active or not.

    Returns ShortcutActionBase

    A pointer to the action bound to the given shortcut key or nullptr if no action is bound to that key.

  • Finds a context by it's path. The path is defined as a sequence of context names separated by "/".

    Parameters

    • path: string

    Returns ShortcutContext

  • Creates new a context by it's path. The path is defined as a sequence of context names separated by "/".

    Parameters

    • path: string

    Returns ShortcutContext

  • Sets the binding for the current profile. This will update the profile as well as all active bindings of the shortcut.

    Parameters

    • identifier: string

    Returns ShortcutKey

  • Sets the binding for the current profile. This will update the profile as well as all active bindings of the shortcut.

    Parameters

    Returns void