Package com.vaadin.flow.component
Interface KeyNotifier
- All Superinterfaces:
Serializable
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 RegistrationaddKeyDownListener(ComponentEventListener<KeyDownEvent> listener) Adds akeydownlistener to this component.default RegistrationaddKeyDownListener(Key key, ComponentEventListener<KeyDownEvent> listener, KeyModifier... modifiers) Adds akeydownlistener to this component, which will trigger only if the keys involved in the event match thekeyandmodifiersparameters.default RegistrationAdds akeypresslistener to this component.default RegistrationaddKeyPressListener(Key key, ComponentEventListener<KeyPressEvent> listener, KeyModifier... modifiers) Adds akeypresslistener to this component, which will trigger only if the keys involved in the event match thekeyandmodifiersparameters.default RegistrationaddKeyUpListener(ComponentEventListener<KeyUpEvent> listener) Adds akeyuplistener to this component.default RegistrationaddKeyUpListener(Key key, ComponentEventListener<KeyUpEvent> listener, KeyModifier... modifiers) Adds akeyuplistener to this component, which will trigger only if the keys involved in the event match thekeyandmodifiersparameters.
-
Method Details
-
addKeyDownListener
Adds akeydownlistener to this component.- Parameters:
listener- the listener to add, notnull- Returns:
- a handle that can be used for removing the listener
-
addKeyPressListener
Adds akeypresslistener to this component.- Parameters:
listener- the listener to add, notnull- Returns:
- a handle that can be used for removing the listener
-
addKeyUpListener
Adds akeyuplistener 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 akeydownlistener to this component, which will trigger only if the keys involved in the event match thekeyandmodifiersparameters.See
Keyfor 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, notnullmodifiers- 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 akeypresslistener to this component, which will trigger only if the keys involved in the event match thekeyandmodifiersparameters.See
Keyfor 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, notnullmodifiers- 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 akeyuplistener to this component, which will trigger only if the keys involved in the event match thekeyandmodifiersparameters.See
Keyfor 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, notnullmodifiers- the optional modifiers to match- Returns:
- a handle that can be used for removing the listener
-