Sequenceablepublic abstract class TouchEvent extends ManipulationEvent
Information about a touch event includes the finger positions in multi-finger touch, touch pressure, and touch radius. A standard event is used to indicate the user intent. Its definition is irrelevant of the input device type. The system maps a basic interaction event of another type of input to a standard interaction event of a touch input. The mapping is as follows: For basic mouse interaction events:
PRIMARY_POINT_DOWN.POINT_MOVE.PRIMARY_POINT_UP.HOVER_POINTER_ENTER, HOVER_POINTER_MOVE, and
HOVER_POINTER_EXIT.
For basic stylus interaction events:
PRIMARY_POINT_DOWN.POINT_MOVE.PRIMARY_POINT_UP.ManipulationEvent,
MouseEvent,
StylusEventSystemCapability.MultimodalInput#MULTIMODAL_INPUTSequenceable.Producer<T>| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
CANCEL |
Indicates that the event is interrupted or canceled.
|
static int |
HOVER_POINTER_ENTER |
Indicates that the hover pointer enters a window or component.
|
static int |
HOVER_POINTER_EXIT |
Indicates that the hover pointer leaves a window or component.
|
static int |
HOVER_POINTER_MOVE |
Indicates that the hover pointer moves in a window or component.
|
static int |
NONE |
Indicates no touch activity.
|
static int |
OTHER_POINT_DOWN |
Indicates that another finger touches on the screen when one finger or more already touch
on the screen.
|
static int |
OTHER_POINT_UP |
Indicates some fingers lift up from the screen while some remain on the screen.
|
static int |
POINT_MOVE |
Indicates that the finger moves on the screen.
|
static int |
PRIMARY_POINT_DOWN |
Indicates that the first finger touches the screen.
|
static int |
PRIMARY_POINT_UP |
Indicates that the last finger lifts up from the screen.
|
PHASE_CANCEL, PHASE_COMPLETED, PHASE_MOVE, PHASE_NONE, PHASE_STARTBUILTIN_KEY, DEFAULT_TYPE, highLevelEvent, KEYBOARD, MOUSE, ROTATION, SPEECH, STYLUS, TOUCH_PANEL, UNSUPPORTED_DEVICE, uuid| 构造器 | 说明 |
|---|---|
TouchEvent() |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
abstract int |
getAction() |
Obtains the current pointer action status.
|
abstract int |
getIndex() |
Obtains the index of the pointer action.
|
MultimodalEvent |
getMultimodalEvent() |
Obtains the original multimodal input event that has been mapped to a standard interaction event.
|
getForce, getPhase, getPointerCount, getPointerId, getPointerPosition, getPointerScreenPosition, getRadius, getStartTime, setScreenOffsetgetDeviceId, getInputDeviceId, getOccurredTime, getSourceDevice, getUuid, isSameEvent, marshalling, unmarshallingclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithasFileDescriptorpublic static final int CANCEL
public static final int HOVER_POINTER_ENTER
public static final int HOVER_POINTER_EXIT
public static final int HOVER_POINTER_MOVE
public static final int NONE
public static final int OTHER_POINT_DOWN
public static final int OTHER_POINT_UP
public static final int POINT_MOVE
public static final int PRIMARY_POINT_DOWN
public static final int PRIMARY_POINT_UP
public MultimodalEvent getMultimodalEvent()
After an original multimodal input event is mapped to a standard interaction event, you can call this method to obtain the original event. For example, after a mouse event is mapped to a touch event, this method returns the mouse event.
MultimodalEventpublic abstract int getAction()
PRIMARY_POINT_DOWN, PRIMARY_POINT_UP, POINT_MOVE,
OTHER_POINT_DOWN, or OTHER_POINT_UP.public abstract int getIndex()
This method obtains the pointer index of the pointer action, for example,
OTHER_POINT_DOWN or OTHER_POINT_UP. Based on the index, you can obtain
information such as the touch pressure and touch radius.
ManipulationEvent#getPointerCount()-1.