Package com.vaadin.flow.component
Class KeyEventListener<E extends KeyboardEvent>
- java.lang.Object
-
- com.vaadin.flow.component.KeyEventListener<E>
-
- Type Parameters:
E
- the type of theKeyboardEvent
- All Implemented Interfaces:
ComponentEventListener<E>
,Serializable
,EventListener
public class KeyEventListener<E extends KeyboardEvent> extends Object implements ComponentEventListener<E>
A conditional event listener forKeyboardEvent
s.- Since:
- 1.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description KeyEventListener(ComponentEventListener<E> listener, Key key, KeyModifier... modifiers)
Create a listener which will delegate tolistener
only ifkey
is the target key.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onComponentEvent(E event)
Invoked when a component event has been fired.
-
-
-
Constructor Detail
-
KeyEventListener
public KeyEventListener(ComponentEventListener<E> listener, Key key, KeyModifier... modifiers)
Create a listener which will delegate tolistener
only ifkey
is the target key. If anymodifiers
is required, the delegation occurs only if all the modifiers keys where pressed.- Parameters:
listener
- the listener to delegatekey
- the key to checkmodifiers
- the optional modifier keys
-
-
Method Detail
-
onComponentEvent
public void onComponentEvent(E event)
Description copied from interface:ComponentEventListener
Invoked when a component event has been fired.- Specified by:
onComponentEvent
in interfaceComponentEventListener<E extends KeyboardEvent>
- Parameters:
event
- component event
-
-