harmony 鸿蒙@ohos.multimodalInput.mouseEvent (Mouse Event)

2022-08-09 浏览 (938)

@ohos.multimodalInput.mouseEvent (Mouse Event)

The mouseEvent module provides mouse events reported by a device. It is inherited from InputEvent.

NOTE

The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.

Modules to Import

import { Action, Button, Axis, AxisValue, MouseEvent } from '@ohos.multimodalInput.mouseEvent';

Action

Enumerates mouse event types.

System capability: SystemCapability.MultimodalInput.Input.Core

NameValueDescription
CANCEL0Cancellation of a mouse action.
MOVE1Moving of the mouse pointer.
BUTTON_DOWN2Pressing of a mouse button.
BUTTON_UP3Release of a mouse button.
AXIS_BEGIN4Beginning of the axis event associated with the mouse.
AXIS_UPDATE5Updating of the axis event associated with the mouse.
AXIS_END6Ending of the axis event associated with the mouse.
ACTION_DOWN11+7Finger pressing on the touchpad.
ACTION_UP11+8Finger lift from the touchpad.

Button

Enumerates mouse buttons.

System capability: SystemCapability.MultimodalInput.Input.Core

NameValueDescription
LEFT0Left button on the mouse.
MIDDLE1Middle button on the mouse.
RIGHT2Right button on the mouse.
SIDE3Side button on the mouse.
EXTRA4Extended button on the mouse.
FORWARD5Forward button on the mouse.
BACK6Back button on the mouse.
TASK7Task button on the mouse.

Axis

Enumerates mouse axis types.

System capability: SystemCapability.MultimodalInput.Input.Core

NameValueDescription
SCROLL_VERTICAL0Vertical scroll axis.
SCROLL_HORIZONTAL1Horizontal scroll axis.
PINCH2Pinch axis.

AxisValue

Defines the mouse axis type and axis value.

System capability: SystemCapability.MultimodalInput.Input.Core

NameTypeReadableWritableDescription
axisAxisYesNoAxis type.
valuenumberYesNoAxis value.

ToolType11+

Enumerates tool types.

System capability: SystemCapability.MultimodalInput.Input.Core

NameValueDescription
UNKNOWN11+0Unknown.
MOUSE11+1Mouse.
TOUCHSCREEN11+2Touchscreen.
TOUCHPAD11+3Touchpad.
JOYSTICK11+4Joystick.

MouseEvent

Defines the mouse event.

System capability: SystemCapability.MultimodalInput.Input.Core

NameTypeReadableWritableDescription
actionActionYesNoMouse event action.
screenXnumberYesNoHorizontal coordinate of the mouse pointer on the screen.
screenYnumberYesNoVertical coordinate of the mouse pointer on the screen.
windowXnumberYesNoHorizontal coordinate of the mouse pointer in the window.
windowYnumberYesNoVertical coordinate of the mouse pointer in the window.
rawDeltaXnumberYesNoHorizontal coordinate offset relative to the previous reported mouse pointer position.
rawDeltaYnumberYesNoVertical coordinate offset relative to the previous reported mouse pointer position.
buttonButtonYesNoMouse button
pressedButtonsButton[]YesNoButton being pressed.
axesAxisValue[]YesNoAll axis data contained in the event.
pressedKeysKeyCode[]YesNoList of pressed keys.
ctrlKeybooleanYesNoWhether ctrlKey is being pressed.
The value true indicates that the key is pressed, and the value false indicates the opposite.
altKeybooleanYesNoWhether altKey is being pressed.
shiftKeybooleanYesNoWhether shiftKey is being pressed.
logoKeybooleanYesNoWhether logoKey is being pressed.
fnKeybooleanYesNoWhether fnKey is being pressed.
capsLockbooleanYesNoWhether capsLock is active.
The value true indicates that capsLock is active, and the value false indicates the opposite.
numLockbooleanYesNoWhether numLock is active.
scrollLockbooleanYesNoWhether scrollLock is active.
toolType11+ToolTypeYesNoTool type.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙APIs

harmony 鸿蒙System Common Events (To Be Deprecated Soon)

harmony 鸿蒙System Common Events

harmony 鸿蒙API Reference Document Description

harmony 鸿蒙Enterprise Device Management Overview (for System Applications Only)

harmony 鸿蒙BundleStatusCallback

harmony 鸿蒙@ohos.bundle.innerBundleManager (innerBundleManager)

harmony 鸿蒙@ohos.distributedBundle (Distributed Bundle Management)

harmony 鸿蒙@ohos.bundle (Bundle)

harmony 鸿蒙@ohos.enterprise.EnterpriseAdminExtensionAbility (EnterpriseAdminExtensionAbility)

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/22542c68d2da44eaaa623673f1b34018