SequenceableStylusEvent, TouchEventpublic abstract class ManipulationEvent extends MultimodalEvent
ManipulationEvent defines and abstracts all manipulation events, such as finger touch events. Such an event carries information including the event location and phase. Generally, the events are used as the input of the callback to capture and process the events. The callback divides an action into three phases: start, operating, and end. For example, for one finger touch, start means that a finger touches the screen, operating means that the finger moves on the screen, and end means that the finger lifts up from the screen.
MultimodalEvent,
MmiPointSystemCapability.MultimodalInput#MULTIMODAL_INPUTSequenceable.Producer<T>| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
PHASE_CANCEL |
Indicates that the action has been canceled.
|
static int |
PHASE_COMPLETED |
Indicates that the action has ended.
|
static int |
PHASE_MOVE |
Indicates that the action is in process.
|
static int |
PHASE_NONE |
Indicates an invalid action.
|
static int |
PHASE_START |
Indicates that the action has started.
|
BUILTIN_KEY, DEFAULT_TYPE, highLevelEvent, KEYBOARD, MOUSE, ROTATION, SPEECH, STYLUS, TOUCH_PANEL, UNSUPPORTED_DEVICE, uuid| 构造器 | 说明 |
|---|---|
ManipulationEvent() |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
abstract float |
getForce(int index) |
Obtains the touch pressure of the finger with a specified index.
|
abstract int |
getPhase() |
Obtains the operation phase of the event.
|
abstract int |
getPointerCount() |
Obtains the number of pointers for touch control or trajectory tracking in an event.
|
abstract int |
getPointerId(int index) |
Obtains the unique ID of a pointer in an event.
|
abstract MmiPoint |
getPointerPosition(int index) |
Obtains the x and y coordinates of a pointer index relative to the offset position during
touch control or trajectory tracking in an event.
|
abstract MmiPoint |
getPointerScreenPosition(int index) |
Obtains the x and y coordinates of a pointer index relative to the screen coordinate origin during
touch control or trajectory tracking in an event.
|
abstract float |
getRadius(int index) |
Obtains the touch radius of the finger with a specified index.
|
abstract long |
getStartTime() |
Obtains the time (in ms) of the operation start phase.
|
abstract void |
setScreenOffset(float offsetX,
float offsetY) |
Sets the offset position relative to the screen.
|
getDeviceId, getInputDeviceId, getOccurredTime, getSourceDevice, getUuid, isSameEvent, marshalling, unmarshallingclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithasFileDescriptorpublic static final int PHASE_CANCEL
public static final int PHASE_COMPLETED
public static final int PHASE_MOVE
public static final int PHASE_NONE
public static final int PHASE_START
public abstract long getStartTime()
public abstract int getPhase()
The operation phase can be PHASE_NONE, PHASE_START, PHASE_MOVE,
PHASE_COMPLETED, or PHASE_CANCEL.
PHASE_NONE,
PHASE_START, PHASE_MOVE, PHASE_COMPLETED, or PHASE_CANCEL.public abstract MmiPoint getPointerPosition(int index)
index - Indicates the pointer index mapping to the pointer action in the event. The
value ranges from 0 to getPointerCount()-1. For the mouse and stylus, only a
single pointer action is supported. When the location information is obtained, the pointer
index is set to 0.public abstract void setScreenOffset(float offsetX,
float offsetY)
offsetX - Indicates the offset relative to the x on the upper left corner of the screen.offsetY - Indicates the offset relative to the y on the upper left corner of the screen.public abstract MmiPoint getPointerScreenPosition(int index)
index - Indicates the pointer index mapping to the pointer ID in the event. The value
ranges from 0 to getPointerCount()-1. For the mouse and stylus, only a single
pointer action is supported. When the pointer ID is obtained, the pointer index is set to
0.public abstract int getPointerCount()
public abstract int getPointerId(int index)
index - Indicates the pointer index mapping to the pointer ID in the event. The value
ranges from 0 to getPointerCount()-1. For the mouse and stylus, only a single
pointer action is supported. When the pointer ID is obtained, the pointer index is set to
0.public abstract float getForce(int index)
The touch pressure of a finger generally ranges from 0 to 1.0. Depending on the calibration of the input device, a value greater than 1 may be generated sometimes.
index - Indicates the index of the touch finger. The value ranges from 0 to
getPointerCount()-1. The position of the touch finger in the current event can be
obtained based on its unique ID. For the mouse and stylus action events, only a single
pointer action is supported. When the pressure information is obtained, the index is set
to 0. For the mouse action event, the touch pressure is 1.0 when the left
button is pressed and is 0 in other cases.public abstract float getRadius(int index)
The touch radius indicates the area the finger touches on the screen.
index - Indicates the index of the touch finger. The value ranges from 0 to
getPointerCount()-1. The position of the touch finger in the current event can be
obtained based on its unique ID. For the mouse and stylus action events, only a single
pointer action is supported. When the screen size is obtained, the index is set to
0. For the mouse action event, the touch radius has a fixed value of 0.