Class MouseEventTrigger.EventData

java.lang.Object
com.vaadin.flow.component.trigger.internal.MouseEventTrigger.EventData
All Implemented Interfaces:
Serializable
Enclosing class:
MouseEventTrigger

public abstract static class MouseEventTrigger.EventData extends Object implements Serializable
The MouseEvent properties exposed as static Action.Input sources. Each field reads one property off the DOM event that fires the trigger; pass any of them as the value source of an Action wired to a MouseEventTrigger subclass.

Each field is bound to MouseEventTrigger; using it in the handler of an unrelated trigger (e.g. a keyboard trigger) throws IllegalArgumentException at Trigger.triggers(Action...) time.

Trigger subclasses that need their own properties may declare their own nested EventData extending this class — the inherited static fields remain reachable through the subclass, so ClickTrigger.EventData.screenX continues to resolve to screenX.

See Also:
  • Field Details

    • screenX

      public static final Action.Input<Integer> screenX
      event.screenX — X coordinate relative to the screen.
    • screenY

      public static final Action.Input<Integer> screenY
      event.screenY — Y coordinate relative to the screen.
    • clientX

      public static final Action.Input<Integer> clientX
      event.clientX — X coordinate relative to the viewport.
    • clientY

      public static final Action.Input<Integer> clientY
      event.clientY — Y coordinate relative to the viewport.
    • button

      public static final Action.Input<Integer> button
      event.button — which mouse button changed state: 0 main (usually left), 1 auxiliary (usually middle), 2 secondary (usually right), 3/4 fourth (back) / fifth (forward) browser buttons.
    • shiftKey

      public static final Action.Input<Boolean> shiftKey
      event.shiftKey — whether shift was held during the event.
    • ctrlKey

      public static final Action.Input<Boolean> ctrlKey
      event.ctrlKey — whether ctrl was held during the event.
    • altKey

      public static final Action.Input<Boolean> altKey
      event.altKey — whether alt was held during the event.
    • metaKey

      public static final Action.Input<Boolean> metaKey
      event.metaKey — whether meta was held during the event.
  • Constructor Details

    • EventData

      protected EventData()
      The class exists purely as a namespace for the static Action.Input fields.