Interface ShortcutRegistration.ShortcutFilterJs

All Superinterfaces:
Serializable
Enclosing class:
ShortcutRegistration

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

The keys, modifiers and options of a shortcut are captured values rather than part of the JavaScript, so every shortcut runs the same function, and shortcuts with the same settings share them through the constant pool.

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

See Also:
  • Method Details

    • matchKeydown

      @JsExpression("return window.Vaadin.Flow.shortcut.matchKeydown(event, {\n keys: $7,\n requiredModifiers: $0,\n forbiddenModifiers: $1,\n checkOwnerScope: $2,\n ownerSelector: $3,\n preventDefault: $4,\n stopPropagation: $5,\n resetFocus: $6\n});") DomEventFilter matchKeydown(String requiredModifiers, String forbiddenModifiers, boolean checkOwnerScope, String ownerSelector, boolean preventDefault, boolean stopPropagation, boolean resetFocus, String... keys)
      Creates the filter for DomListenerRegistration.setFilterExpression(DomEventFilter) that passes a keydown that matches the given key and modifiers. A keydown that passes gets the side effects that are asked for.
      Parameters:
      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
      checkOwnerScope - whether to ignore a keydown that does not originate from the popover or modal scope of the shortcut owner
      ownerSelector - the selector that finds the owner element when the scope is checked, or null when the owner is the UI, which is never inside a popover or modal
      preventDefault - whether to prevent the default behavior of a matching keydown
      stopPropagation - whether to stop the propagation of a matching keydown
      resetFocus - whether to reset the focus of the active element for a matching keydown
      keys - the key codes and key values that the keydown matches
      Returns:
      the filter, not null