1# @ohos.multimodalInput.mouseEvent (Mouse Event)
2
3The **mouseEvent** module provides mouse events reported by a device. It is inherited from [InputEvent](./js-apis-inputevent.md).
4
5>  **NOTE**
6>
7> 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.
8
9## Modules to Import
10
11```js
12import { Action, Button, Axis, AxisValue, MouseEvent } from '@kit.InputKit';
13```
14
15## Action
16
17Enumerates mouse event types.
18
19**System capability**: SystemCapability.MultimodalInput.Input.Core
20
21| Name       | Value| Description                |
22| ----------- | -------- | -------------------- |
23| CANCEL      | 0   | Cancellation of a mouse action.            |
24| MOVE        | 1   | Moving of the mouse pointer.            |
25| BUTTON_DOWN | 2   | Pressing of a mouse button.        |
26| BUTTON_UP   | 3   | Release of a mouse button.        |
27| AXIS_BEGIN  | 4   | Beginning of the axis event associated with the mouse.|
28| AXIS_UPDATE | 5   | Updating of the axis event associated with the mouse.|
29| AXIS_END    | 6   | Ending of the axis event associated with the mouse.|
30| ACTION_DOWN<sup>11+</sup> | 7   | Finger pressing on the touchpad.|
31| ACTION_UP<sup>11+</sup> | 8   | Finger lift from the touchpad.|
32
33## Button
34
35Enumerates mouse buttons.
36
37**System capability**: SystemCapability.MultimodalInput.Input.Core
38
39| Name     | Value | Description   |
40| ------- | ------| ----- |
41| LEFT    | 0 | Left button on the mouse. |
42| MIDDLE  | 1 | Middle button on the mouse. |
43| RIGHT   | 2 | Right button on the mouse. |
44| SIDE    | 3 | Side button on the mouse.|
45| EXTRA   | 4 | Extended button on the mouse.|
46| FORWARD | 5 | Forward button on the mouse.|
47| BACK    | 6 | Back button on the mouse.|
48| TASK    | 7 | Task button on the mouse.|
49
50## Axis
51
52Enumerates mouse axis types.
53
54**System capability**: SystemCapability.MultimodalInput.Input.Core
55
56| Name               | Value    | Description   |
57| ----------------- | ------- | ----- |
58| SCROLL_VERTICAL   | 0 | Vertical scroll axis.|
59| SCROLL_HORIZONTAL | 1 | Horizontal scroll axis.|
60| PINCH             | 2 | Pinch axis.  |
61
62
63## AxisValue
64
65Defines the mouse axis type and axis value.
66
67**System capability**: SystemCapability.MultimodalInput.Input.Core
68
69| Name   | Type  | Readable  | Writable  | Description  |
70| ----- | ------ | ---- | ---- | ---- |
71| axis  | [Axis](#axis)   | Yes   | No   | Axis type. |
72| value | number | Yes   | No   | Axis value. |
73
74## ToolType<sup>11+</sup>
75
76Enumerates tool types.
77
78**System capability**: SystemCapability.MultimodalInput.Input.Core
79
80| Name     | Value | Description   |
81| ------- | ------| ----- |
82| UNKNOWN<sup>11+</sup> | 0 | Unknown. |
83| MOUSE<sup>11+</sup>  | 1 | Mouse.|
84| JOYSTICK<sup>11+</sup> | 2 | Joystick.|
85| TOUCHPAD<sup>11+</sup> | 3 | Touchpad.|
86
87## MouseEvent
88
89Defines the mouse event.
90
91**System capability**: SystemCapability.MultimodalInput.Input.Core
92
93| Name            | Type       | Readable  | Writable  | Description                                      |
94| -------------- | ----------- | ---- | ---- | ---------------------------------------- |
95| action         | [Action](#action)      | Yes   | No   | Mouse event action.                                  |
96| screenX        | number      | Yes   | No   | Horizontal coordinate of the mouse pointer on the screen.                            |
97| screenY        | number      | Yes   | No   | Vertical coordinate of the mouse pointer on the screen.                            |
98| windowX        | number      | Yes   | No   | Horizontal coordinate of the mouse pointer in the window.                              |
99| windowY        | number      | Yes   | No   | Vertical coordinate of the mouse pointer in the window.                              |
100| rawDeltaX      | number      | Yes   | No   | Horizontal coordinate offset relative to the previous reported mouse pointer position.|
101| rawDeltaY      | number      | Yes   | No   | Vertical coordinate offset relative to the previous reported mouse pointer position.                         |
102| button         | [Button](#button)      | Yes   | No   | Mouse button
103| pressedButtons | [Button](#button)[]    | Yes   | No   | Button being pressed.                             |
104| axes           | [AxisValue](#axisvalue)[] | Yes   | No   | All axis data contained in the event.                              |
105| pressedKeys    | [KeyCode](js-apis-keycode.md#keycode)[]   | Yes   | No   | List of pressed keys.                           |
106| ctrlKey        | boolean     | Yes   | No   | Whether ctrlKey is being pressed.<br>The value **true** indicates that the key is pressed, and the value **false** indicates the opposite.   |
107| altKey         | boolean     | Yes   | No   | Whether altKey is being pressed.<br>The value **true** indicates that the key is pressed, and the value **false** indicates the opposite.                        |
108| shiftKey       | boolean     | Yes   | No   | Whether shiftKey is being pressed.<br>The value **true** indicates that the key is pressed, and the value **false** indicates the opposite.                      |
109| logoKey        | boolean     | Yes   | No   | Whether logoKey is being pressed.<br>The value **true** indicates that the key is pressed, and the value **false** indicates the opposite.                       |
110| fnKey          | boolean     | Yes   | No   | Whether fnKey is being pressed.<br>The value **true** indicates that the key is pressed, and the value **false** indicates the opposite.                         |
111| capsLock       | boolean     | Yes   | No   | Whether capsLock is active.<br>The value **true** indicates that capsLock is active, and the value **false** indicates the opposite. |
112| numLock        | boolean     | Yes   | No   | Whether numLock is active.<br>The value **true** indicates that capsLock is active, and the value **false** indicates the opposite.                       |
113| scrollLock     | boolean     | Yes   | No   | Whether scrollLock is active.<br>The value **true** indicates that capsLock is active, and the value **false** indicates the opposite.                    |
114| toolType<sup>11+</sup> | [ToolType](#tooltype11) | Yes   | No   | Tool type.                    |
115