Interface ShortcutRegistration.ShortcutJs

All Superinterfaces:
Serializable
Enclosing class:
ShortcutRegistration

@JsDefinition public static interface ShortcutRegistration.ShortcutJs extends Serializable
The keydown delegate of a keyboard shortcut, as a JavaScript definition for Element.executeJs(Class). The function it calls is installed by the shortcut helper that the client bundle carries.

For internal use only. May be renamed or removed in a future release.

Since:
25.4
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    registerKeydownDelegate(JsFunction locateDelegate, String requiredModifiers, String forbiddenModifiers, boolean checkBoundary, boolean resetFocus, boolean allowDefault, String... keys)
    Relays the keydown events of an element that only exists in the browser to the element this definition was obtained from, the listen-on component of a shortcut.
  • Method Details

    • registerKeydownDelegate

      @JsExpression("window.Vaadin.Flow.shortcut.registerKeydownDelegate(this, $0, {\n keys: $6,\n requiredModifiers: $1,\n forbiddenModifiers: $2,\n checkBoundary: $3,\n resetFocus: $4,\n allowDefault: $5\n});") void registerKeydownDelegate(JsFunction locateDelegate, String requiredModifiers, String forbiddenModifiers, boolean checkBoundary, boolean resetFocus, boolean allowDefault, String... keys)
      Relays the keydown events of an element that only exists in the browser to the element this definition was obtained from, the listen-on component of a shortcut. A keydown that matches the given key and modifiers is re-dispatched to the listen-on element, and its propagation is stopped.
      Parameters:
      locateDelegate - the function that returns the element to listen on, called with the listen-on element as this, see Shortcuts.setShortcutListenOnElementLocator(JsFunction, Component)
      requiredModifiers - the names of the modifiers that have to be pressed, separated by spaces
      forbiddenModifiers - the names of the modifiers that must not be pressed, separated by spaces
      checkBoundary - whether to ignore a keydown from an open popover or modal inside the element to listen on
      resetFocus - whether to reset the focus of the active element before the keydown is relayed
      allowDefault - whether to allow the default behavior of a matching keydown
      keys - the key codes and key values that the keydown matches