Package com.vaadin.flow.component
Interface KeyNotifier
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractNumberField
,BigDecimalField
,EmailField
,IntegerField
,NumberField
,PasswordField
,RichTextEditor
,TextArea
,TextField
,TextFieldBase
Mixin interface for components that support adding key event listeners to the
their root elements.
- Since:
- 1.0
- Author:
- Vaadin Ltd
-
Method Summary
Modifier and TypeMethodDescriptiondefault Registration
addKeyDownListener
(ComponentEventListener<KeyDownEvent> listener) Adds akeydown
listener to this component.default Registration
addKeyDownListener
(Key key, ComponentEventListener<KeyDownEvent> listener, KeyModifier... modifiers) Adds akeydown
listener to this component, which will trigger only if the keys involved in the event match thekey
andmodifiers
parameters.default Registration
Adds akeypress
listener to this component.default Registration
addKeyPressListener
(Key key, ComponentEventListener<KeyPressEvent> listener, KeyModifier... modifiers) Adds akeypress
listener to this component, which will trigger only if the keys involved in the event match thekey
andmodifiers
parameters.default Registration
addKeyUpListener
(ComponentEventListener<KeyUpEvent> listener) Adds akeyup
listener to this component.default Registration
addKeyUpListener
(Key key, ComponentEventListener<KeyUpEvent> listener, KeyModifier... modifiers) Adds akeyup
listener to this component, which will trigger only if the keys involved in the event match thekey
andmodifiers
parameters.
-
Method Details
-
addKeyDownListener
Adds akeydown
listener to this component.- Parameters:
listener
- the listener to add, notnull
- Returns:
- a handle that can be used for removing the listener
-
addKeyPressListener
Adds akeypress
listener to this component.- Parameters:
listener
- the listener to add, notnull
- Returns:
- a handle that can be used for removing the listener
-
addKeyUpListener
Adds akeyup
listener to this component.- Parameters:
listener
- the listener to add, notnull
- Returns:
- a handle that can be used for removing the listener
-
addKeyDownListener
default Registration addKeyDownListener(Key key, ComponentEventListener<KeyDownEvent> listener, KeyModifier... modifiers) Adds akeydown
listener to this component, which will trigger only if the keys involved in the event match thekey
andmodifiers
parameters.See
Key
for common static instances or useKey.of(String, String...)
to get an instance from an arbitrary value.- Parameters:
key
- the key to matchlistener
- the listener to add, notnull
modifiers
- the optional modifiers to match- Returns:
- a handle that can be used for removing the listener
-
addKeyPressListener
default Registration addKeyPressListener(Key key, ComponentEventListener<KeyPressEvent> listener, KeyModifier... modifiers) Adds akeypress
listener to this component, which will trigger only if the keys involved in the event match thekey
andmodifiers
parameters.See
Key
for common static instances or useKey.of(String, String...)
to get an instance from an arbitrary value.- Parameters:
key
- the key to matchlistener
- the listener to add, notnull
modifiers
- the optional modifiers to match- Returns:
- a handle that can be used for removing the listener
-
addKeyUpListener
default Registration addKeyUpListener(Key key, ComponentEventListener<KeyUpEvent> listener, KeyModifier... modifiers) Adds akeyup
listener to this component, which will trigger only if the keys involved in the event match thekey
andmodifiers
parameters.See
Key
for common static instances or useKey.of(String, String...)
to get an instance from an arbitrary value.- Parameters:
key
- the key to matchlistener
- the listener to add, notnull
modifiers
- the optional modifiers to match- Returns:
- a handle that can be used for removing the listener
-