java.lang.Object
java.util.EventObject
com.vaadin.flow.component.ComponentEvent<LeafletMap>
org.vaadin.addons.componentfactory.leaflet.layer.events.LeafletEvent
org.vaadin.addons.componentfactory.leaflet.layer.events.KeyboardEvent
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
KeyDownEvent, KeyPressEvent, KeyUpEvent

public abstract class KeyboardEvent extends LeafletEvent
Base class for keyboard events fired by a LeafletMap when the user interacts with the keyboard while the map is focused. Holds the details of the key that triggered the event as well as the state of the modifier keys.
See Also:
  • Field Summary

    Fields inherited from class java.util.EventObject

    source
  • Constructor Summary

    Constructors
    Constructor
    Description
    KeyboardEvent(LeafletMap source, boolean fromClient, String layerId, KeyboardEventType eventType, String key, String code, int keyCode, boolean ctrlKey, boolean shiftKey, boolean altKey)
    Creates a new keyboard event.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the code of the key that triggered the event
    Returns the key value of the key represented by the event
    int
    Returns the Unicode character code of the key that triggered the onkeypress event, or the Unicode key code of the key that triggered the onkeydown or onkeyup event
    boolean
    Returns whether the "ALT" key was pressed when the key event was triggered
    boolean
    Returns whether the "CTRL" key was pressed when the key event was triggered
    boolean
    Returns whether the "SHIFT" key was pressed when the key event was triggered
     

    Methods inherited from class org.vaadin.addons.componentfactory.leaflet.layer.events.LeafletEvent

    getLayerId, getType

    Methods inherited from class com.vaadin.flow.component.ComponentEvent

    getSource, getUI, isFromClient, unregisterListener

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • KeyboardEvent

      public KeyboardEvent(LeafletMap source, boolean fromClient, String layerId, KeyboardEventType eventType, String key, String code, int keyCode, boolean ctrlKey, boolean shiftKey, boolean altKey)
      Creates a new keyboard event.
      Parameters:
      source - the map that fired the event
      fromClient - true if the event originated from the client side
      layerId - the identifier of the layer the event is associated with
      eventType - the type of keyboard event
      key - the key value of the key represented by the event
      code - the code of the key that triggered the event
      keyCode - the Unicode character or key code of the key that triggered the event
      ctrlKey - whether the "CTRL" key was pressed when the event was triggered
      shiftKey - whether the "SHIFT" key was pressed when the event was triggered
      altKey - whether the "ALT" key was pressed when the event was triggered
  • Method Details

    • getCode

      public String getCode()
      Returns the code of the key that triggered the event
      Returns:
      the code
    • getKey

      public String getKey()
      Returns the key value of the key represented by the event
      Returns:
      the key
    • getKeyCode

      public int getKeyCode()
      Returns the Unicode character code of the key that triggered the onkeypress event, or the Unicode key code of the key that triggered the onkeydown or onkeyup event
      Returns:
      the keyCode
    • isShiftKey

      public boolean isShiftKey()
      Returns whether the "SHIFT" key was pressed when the key event was triggered
      Returns:
      the shiftKey
    • isAltKey

      public boolean isAltKey()
      Returns whether the "ALT" key was pressed when the key event was triggered
      Returns:
      the altKey
    • isCtrlKey

      public boolean isCtrlKey()
      Returns whether the "CTRL" key was pressed when the key event was triggered
      Returns:
      the ctrlKey
    • toString

      public String toString()
      Overrides:
      toString in class LeafletEvent