SequenceableCompositeEvent, KeyEvent, ManipulationEvent, RotationEvent, SpeechEventpublic abstract class MultimodalEvent extends Object implements Sequenceable
This class defines a series of high-level event types that represent abstracted user
behaviors or intents. In addition, it defines the methods and information shared by various
child classes. If you only want to capture the abstracted behaviors in events, you just need
to rewrite the callback interfaces defined in this class. If you want to obtain more
information, then you can directly use the methods defined in this class. If the callback and
event processing methods for abstracted events cannot meet your needs, you can also convert
the events into more specific event types. For example, you can convert MultimodalEvent
into KeyboardEvent, so as to obtain more detailed information or use a more direct
and simple callback interface.
SystemCapability.MultimodalInput#MULTIMODAL_INPUTSequenceable.Producer<T>| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
BUILTIN_KEY |
Indicates a builtin key input event.
|
static int |
DEFAULT_TYPE |
Indicates the default value of the standard high-level event supported by the OS system.
|
protected int |
highLevelEvent |
Indicates a high-level event.
|
static int |
KEYBOARD |
Indicates a keyboard input event.
|
static int |
MOUSE |
Indicates a mouse input event.
|
static int |
ROTATION |
Indicates the event generated by a rotation component.
|
static int |
SPEECH |
Indicates the event generated by Speech component.
|
static int |
STYLUS |
Indicates a stylus input event.
|
static int |
TOUCH_PANEL |
Indicates a touch panel (TP) input event.
|
static int |
UNSUPPORTED_DEVICE |
Indicates that there is no input device.
|
protected UUID |
uuid |
Indicates a globally unique ID that helps distinguish one event from others.
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
abstract String |
getDeviceId() |
Obtains the ID of the bearing device for the input device that generates the current event.
|
abstract int |
getInputDeviceId() |
Obtains the ID of the input device that generates the current event.
|
abstract long |
getOccurredTime() |
Obtains the time when the current event is generated.
|
abstract int |
getSourceDevice() |
Obtains the type of the input device that generates the current event.
|
UUID |
getUuid() |
Obtains the UUID of the event.
|
boolean |
isSameEvent(UUID id) |
Checks whether the current event is the same as the event with the specified UUID.
|
boolean |
marshalling(Parcel parcel) |
Marshals this
Sequenceable object into a Parcel. |
boolean |
unmarshalling(Parcel parcel) |
Unmarshals this
Sequenceable object from a Parcel. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithasFileDescriptorpublic static final int BUILTIN_KEY
public static final int DEFAULT_TYPE
public static final int KEYBOARD
public static final int MOUSE
public static final int ROTATION
public static final int SPEECH
public static final int STYLUS
public static final int TOUCH_PANEL
public static final int UNSUPPORTED_DEVICE
protected int highLevelEvent
MultimodalEvent can be converted to a high-level event.protected final UUID uuid
isSameEvent(java.util.UUID).public boolean isSameEvent(UUID id)
id - Specifies UUID of the event to be checked.true if the current event is the same as the event with the
specified UUID; returns false otherwise.public abstract int getSourceDevice()
UNSUPPORTED_DEVICE: no input device. Generally, this is the default value.
TOUCH_PANEL: touch panel
KEYBOARD: keyboard
MOUSE: mouse
STYLUS: stylus
BUILTIN_KEY: built-in key
ROTATION: rotation component
SPEECH: speech componentpublic abstract String getDeviceId()
For example, if two mouse devices are connected to the same device, this device is the bearing device of the two mouse devices.
null if there is no input device.getInputDeviceId()public abstract int getInputDeviceId()
An input device is identified by a unique ID. For example, when two mouse devices generate an event respectively, the device ID in the generated events are different. This allows your application to use the device ID to identify the actual input device.
-1 if there is no input device.getDeviceId()public abstract long getOccurredTime()
public UUID getUuid()
public boolean marshalling(Parcel parcel)
SequenceableSequenceable object into a Parcel.marshalling 在接口中 Sequenceableparcel - Indicates the Parcel object to which the Sequenceable
object will be marshaled..true if the marshalling is successful; returns false otherwise.public boolean unmarshalling(Parcel parcel)
SequenceableSequenceable object from a Parcel.unmarshalling 在接口中 Sequenceableparcel - Indicates the Parcel object into which the Sequenceable
object has been marshaled.true if the unmarshalling is successful; returns false otherwise.