Package com.vaadin.flow.component
Interface ShortcutRegistration.ShortcutFilterJs
- All Superinterfaces:
Serializable
- Enclosing class:
ShortcutRegistration
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.
- Since:
- 25.4
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionmatchKeydown(String requiredModifiers, String forbiddenModifiers, boolean checkOwnerScope, String ownerSelector, boolean preventDefault, boolean stopPropagation, boolean resetFocus, String... keys) Creates the filter forDomListenerRegistration.setFilterExpression(DomEventFilter)that passes a keydown that matches the given key and modifiers.
-
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 forDomListenerRegistration.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 spacesforbiddenModifiers- the names of the modifiers that must not be pressed, separated by spacescheckOwnerScope- whether to ignore a keydown that does not originate from the popover or modal scope of the shortcut ownerownerSelector- the selector that finds the owner element when the scope is checked, ornullwhen the owner is the UI, which is never inside a popover or modalpreventDefault- whether to prevent the default behavior of a matching keydownstopPropagation- whether to stop the propagation of a matching keydownresetFocus- whether to reset the focus of the active element for a matching keydownkeys- the key codes and key values that the keydown matches- Returns:
- the filter, not
null
-