Class KeyEventListener<E extends KeyboardEvent>

java.lang.Object
com.vaadin.flow.component.KeyEventListener<E>
Type Parameters:
E - the type of the KeyboardEvent
All Implemented Interfaces:
ComponentEventListener<E>, Serializable, EventListener

public class KeyEventListener<E extends KeyboardEvent> extends Object implements ComponentEventListener<E>
A conditional event listener for KeyboardEvents.
Since:
1.0
See Also:
  • Constructor Details

    • KeyEventListener

      public KeyEventListener(ComponentEventListener<E> listener, Key key, KeyModifier... modifiers)
      Create a listener which will delegate to listener only if key is the target key. If any modifiers is required, the delegation occurs only if all the modifiers keys where pressed.
      Parameters:
      listener - the listener to delegate
      key - the key to check
      modifiers - the optional modifier keys
  • Method Details