Package playn.core

Class Event.Input

java.lang.Object
playn.core.Event
playn.core.Event.Input
Direct Known Subclasses:
Event.XY, Keyboard.Event
Enclosing class:
Event

public static class Event.Input extends Event
The base for all input events.
  • Nested Class Summary

    Nested classes/interfaces inherited from class playn.core.Event

    Event.Input, Event.XY
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
    The flags set for this event.
    final double
    The time at which this event was generated, in milliseconds.

    Fields inherited from class playn.core.Event

    F_PREVENT_DEFAULT
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    clearFlag(int flag)
    Clears the flag bit.
    boolean
    Returns true if the alt key was down when this event was generated.
    boolean
    Returns true if the ctrl key was down when this event was generated.
    boolean
    Returns true if the meta key was down when this event was generated.
    boolean
    isSet(int flag)
    Returns whether the flag bit is set.
    boolean
    Returns true if the shift key was down when this event was generated.
    static int
    modifierFlags(boolean altP, boolean ctrlP, boolean metaP, boolean shiftP)
    A helper function used by platform input code to compose modifier flags.
    void
    setFlag(int flag)
    Sets the flag bit.
     
    void
    updateFlag(int flag, boolean on)
    Sets or clears flag based on on.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • flags

      public int flags
      The flags set for this event. See isSet(int), setFlag(int) and clearFlag(int).
    • time

      public final double time
      The time at which this event was generated, in milliseconds. This time's magnitude is not portable (i.e. may not be the same across backends), clients must interpret it as only a monotonically increasing value.
  • Method Details

    • isAltDown

      public boolean isAltDown()
      Returns true if the alt key was down when this event was generated.
    • isCtrlDown

      public boolean isCtrlDown()
      Returns true if the ctrl key was down when this event was generated.
    • isShiftDown

      public boolean isShiftDown()
      Returns true if the shift key was down when this event was generated.
    • isMetaDown

      public boolean isMetaDown()
      Returns true if the meta key was down when this event was generated.
    • isSet

      public boolean isSet(int flag)
      Returns whether the flag bit is set.
    • setFlag

      public void setFlag(int flag)
      Sets the flag bit.
    • clearFlag

      public void clearFlag(int flag)
      Clears the flag bit.
    • updateFlag

      public void updateFlag(int flag, boolean on)
      Sets or clears flag based on on.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • modifierFlags

      public static int modifierFlags(boolean altP, boolean ctrlP, boolean metaP, boolean shiftP)
      A helper function used by platform input code to compose modifier flags.