Package com.myscript.iink
Class PointerEvent
java.lang.Object
com.myscript.iink.PointerEvent
Represents a pointer event.
-
Field Summary
FieldsModifier and TypeFieldDescription@NotNull PointerEventType
The event type.float
The event normalized pressure, in [0,1].float
The event orientation in radians.int
The id of the pointer.@NotNull PointerType
The type of input pointer.long
The event timestamp in ms since Unix EPOCH, or-1
.float
The event tilt in radians.float
The event x coordinate.float
The event y coordinate. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.PointerEvent
(@NotNull PointerEvent other) Copy constructor.PointerEvent
(@NotNull PointerEventType eventType, float x, float y, long t, float f, float tilt, float orientation, @NotNull PointerType pointerType, int pointerId) Constructs a PointerEventPointerEvent
(@NotNull PointerEventType eventType, float x, float y, long t, float f, @NotNull PointerType pointerType, int pointerId) Constructs a PointerEvent -
Method Summary
Modifier and TypeMethodDescription@NotNull PointerEvent
down
(float x, float y) Update this event to a "down" event.boolean
@NotNull PointerEvent
force
(float f) Update the event pressure.final int
hashCode()
boolean
Check whether the event has tilt and orientation information.@NotNull PointerEvent
id
(int pointerId) Update the event pointer id.@NotNull PointerEvent
move
(float x, float y) Update this event to a "move" event.@NotNull PointerEvent
orientationAngle
(float orientation) Update the event orientation angle.@NotNull PointerEvent
tiltAngle
(float tilt) Update the event tilt angle.@NotNull PointerEvent
timestamp
(long t) Update the event timestamp.final @NotNull String
toString()
@NotNull PointerEvent
type
(@NotNull PointerType pointerType) Update the event pointer type.@NotNull PointerEvent
up
(float x, float y) Update this event to a "up" event.
-
Field Details
-
eventType
The event type. -
x
public float xThe event x coordinate. -
y
public float yThe event y coordinate. -
t
public long tThe event timestamp in ms since Unix EPOCH, or-1
. -
f
public float fThe event normalized pressure, in [0,1]. -
tilt
public float tiltThe event tilt in radians.0
is perpendicular,Pi/2
if flat on screen.- Since:
- 4.0
-
orientation
public float orientationThe event orientation in radians.0
is pointing up,-Pi/2
is left,Pi/2
is right,+/-Pi
is down.- Since:
- 4.0
-
pointerType
The type of input pointer. -
pointerId
public int pointerIdThe id of the pointer.
-
-
Constructor Details
-
PointerEvent
public PointerEvent()Default constructor. Construct a Pen Cancel event. -
PointerEvent
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.
-
PointerEvent
public PointerEvent(@NotNull @NotNull PointerEventType eventType, float x, float y, long t, float f, float tilt, float orientation, @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.tilt
- the event tilt in radians.orientation
- the event orientation in radians.pointerType
- the event pointer type.pointerId
- the event pointer identifier.- Since:
- 4.0
-
-
Method Details
-
down
Update this event to a "down" event.- Parameters:
x
- the x coordinate location.y
- the y coordinate location.- Returns:
- this.
-
move
Update this event to a "move" event.- Parameters:
x
- the x coordinate location.y
- the y coordinate location.- Returns:
- this.
-
up
Update this event to a "up" event.- Parameters:
x
- the x coordinate location.y
- the y coordinate location.- Returns:
- this.
-
timestamp
Update the event timestamp.- Parameters:
t
- the timestamp value.- Returns:
- this.
-
force
Update the event pressure.- Parameters:
f
- the pressure value.- Returns:
- this.
-
tiltAngle
Update the event tilt angle.- Parameters:
tilt
- the tilt value.- Returns:
- this.
- Since:
- 4.0
-
orientationAngle
Update the event orientation angle.- Parameters:
orientation
- the orientation value.- Returns:
- this.
- Since:
- 4.0
-
type
Update the event pointer type.- Parameters:
pointerType
- the pointer type.- Returns:
- this.
-
id
Update the event pointer id.- Parameters:
pointerId
- the pointer id value.- Returns:
- this.
-
hasTiltInfo
public boolean hasTiltInfo()Check whether the event has tilt and orientation information.- Returns:
true
if the event has tilt and orientation info, otherwisefalse
.- Since:
- 4.0
-
equals
-
hashCode
public final int hashCode() -
toString
-