Class PointerEvent

java.lang.Object
com.myscript.iink.PointerEvent

public class PointerEvent extends Object
Represents a pointer event.
  • Field Details

    • eventType

      @NotNull public @NotNull PointerEventType eventType
      The event type.
    • x

      public float x
      The event x coordinate.
    • y

      public float y
      The event y coordinate.
    • t

      public long t
      The event timestamp in ms since Unix EPOCH, or -1.
    • f

      public float f
      The event normalised pressure.
    • pointerType

      @NotNull public @NotNull PointerType pointerType
      The type of input pointer.
    • pointerId

      public int pointerId
      The id of the pointer.
  • Constructor Details

    • PointerEvent

      public PointerEvent()
      Default constructor. Construct a Pen Cancel event.
    • PointerEvent

      public PointerEvent(@NotNull @NotNull PointerEvent other)
      Copy constructor.
      Parameters:
      other - the pointer event to copy.
    • PointerEvent

      public PointerEvent(@NotNull @NotNull PointerEventType eventType, float x, float y, long t, float f, @NotNull @NotNull PointerType pointerType, int pointerId)
      Constructs a PointerEvent
      Parameters:
      eventType - the event type.
      x - the event x coordinate.
      y - the event y coordinate.
      t - the event timestamp in ms since Unix EPOCH, or -1.
      f - the event pressure.
      pointerType - the event pointer type.
      pointerId - the event pointer identifier.
  • Method Details

    • down

      @NotNull public @NotNull PointerEvent down(float x, float y)
      Update this event to a "down" event.
      Parameters:
      x - the x coordinate location.
      y - the y coordinate location.
      Returns:
      this.
    • move

      @NotNull public @NotNull PointerEvent move(float x, float y)
      Update this event to a "move" event.
      Parameters:
      x - the x coordinate location.
      y - the y coordinate location.
      Returns:
      this.
    • up

      @NotNull public @NotNull PointerEvent up(float x, float y)
      Update this event to a "up" event.
      Parameters:
      x - the x coordinate location.
      y - the y coordinate location.
      Returns:
      this.
    • timestamp

      @NotNull public @NotNull PointerEvent timestamp(long t)
      Update the event timestamp.
      Parameters:
      t - the timestamp value.
      Returns:
      this.
    • force

      @NotNull public @NotNull PointerEvent force(float f)
      Update the event pressure.
      Parameters:
      f - the presure value.
      Returns:
      this.
    • type

      @NotNull public @NotNull PointerEvent type(@NotNull @NotNull PointerType pointerType)
      Update the event pointer type.
      Parameters:
      pointerType - the pointert type.
      Returns:
      this.
    • id

      @NotNull public @NotNull PointerEvent id(int pointerId)
      Update the event pointer id.
      Parameters:
      pointerId - the pointer id value.
      Returns:
      this.
    • equals

      public boolean equals(@Nullable @Nullable Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      @NotNull public final @NotNull String toString()
      Overrides:
      toString in class Object