Sequenceablepublic abstract class MouseEvent extends CompositeEvent
A reported event can contain both mouse button state change and cursor state change.
CompositeEventSystemCapability.MultimodalInput#MULTIMODAL_INPUTSequenceable.Producer<T>| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
AXIS_X |
Indicates the movement of the mouse pointer or scroll wheel in the X axis.
|
static int |
AXIS_Y |
Indicates the movement of the mouse pointer or scroll wheel in the Y axis.
|
static int |
AXIS_Z |
Indicates the movement of the mouse pointer or scroll wheel in the Z axis.
|
static int |
BACK_BUTTON |
Indicates that the back button on the mouse is pressed.
|
static int |
FORWARD_BUTTON |
Indicates that the forward button on the mouse is pressed.
|
static int |
HOVER_ENTER |
Indicates that a mouse button is not pressed while the cursor moves into the window or view.
|
static int |
HOVER_EXIT |
Indicates the exit of the cursor from a window or view when the left mouse button is not pressed.
|
static int |
HOVER_MOVE |
Indicates the movement of the cursor in a window or view when the left mouse button is not pressed.
|
static int |
LEFT_BUTTON |
Indicates that the left button on the mouse is pressed.
|
static int |
MIDDLE_BUTTON |
Indicates that the middle button on the mouse is pressed.
|
static int |
MOVE |
Indicates the movement of the cursor in a window or view when the left mouse button is pressed.
|
static int |
NONE |
Indicates no mouse action.
|
static int |
NONE_BUTTON |
Indicates that no mouse button is pressed.
|
static int |
PRESS |
Indicates that a mouse button is pressed.
|
static int |
RELEASE |
Indicates that a mouse button is released.
|
static int |
RIGHT_BUTTON |
Indicates that the right button on the mouse is pressed.
|
BUILTIN_KEY, DEFAULT_TYPE, highLevelEvent, KEYBOARD, MOUSE, ROTATION, SPEECH, STYLUS, TOUCH_PANEL, UNSUPPORTED_DEVICE, uuid| 构造器 | 说明 |
|---|---|
MouseEvent() |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
abstract int |
getAction() |
Obtains the mouse action.
|
abstract int |
getActionButton() |
Obtains the mouse button whose status has changed.
|
abstract MmiPoint |
getCursor() |
Obtains the current position of the mouse pointer.
|
abstract float |
getCursorDelta(int axis) |
Obtains the movement of the mouse pointer in the given direction since last call.
|
abstract int |
getPressedButtons() |
Obtains all mouse buttons in the pressed state.
|
abstract float |
getScrollingDelta(int axis) |
Obtains the movement of the scroll wheel in the given direction since last call.
|
abstract void |
setCursorOffset(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 AXIS_X
public static final int AXIS_Y
public static final int AXIS_Z
public static final int BACK_BUTTON
public static final int FORWARD_BUTTON
public static final int HOVER_ENTER
public static final int HOVER_EXIT
public static final int HOVER_MOVE
public static final int LEFT_BUTTON
public static final int MIDDLE_BUTTON
public static final int MOVE
public static final int NONE
public static final int NONE_BUTTON
public static final int PRESS
public static final int RELEASE
public static final int RIGHT_BUTTON
public abstract int getAction()
PRESS, RELEASE, MOVE,
HOVER_ENTER, HOVER_MOVE, or HOVER_EXIT.public abstract int getActionButton()
NONE_BUTTON,
LEFT_BUTTON, RIGHT_BUTTON, MIDDLE_BUTTON, BACK_BUTTON,
or FORWARD_BUTTON. Note that NONE_BUTTON indicates that there is no mouse button whose status
has changed.public abstract int getPressedButtons()
NONE_BUTTON,
or the result of logical OR operations among LEFT_BUTTON, RIGHT_BUTTON, MIDDLE_BUTTON,
BACK_BUTTON, and FORWARD_BUTTON. Note that NONE_BUTTON indicates that there is
no mouse button in the pressed state.NONE_BUTTON,
LEFT_BUTTON,
RIGHT_BUTTON,
MIDDLE_BUTTON,
FORWARD_BUTTONpublic abstract MmiPoint getCursor()
public abstract void setCursorOffset(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 float getCursorDelta(int axis)
public abstract float getScrollingDelta(int axis)