Enables listening for combination key events. When a combination key event that meets the specified conditions occurs, **keyOptions** will be passed as an input parameter to **callback**.
Enables listening for combination key events. When a combination key event that meets the specified conditions occurs, **keyOptions** will be passed as an input parameter to **callback**.
| type | string | Yes| Type of the key input event to listen for. Only **key** is supported.|
| type | string | Yes| Type of the key input event to listen for. Only **key** is supported.|
| keyOptions | [keyOptions](#keyOptions) | Yes| Key option, which specifies the condition for combination key input.|
| keyOptions | [keyOptions](#keyOptions) | Yes| Key option, which specifies the condition for combination key input.|
| callback | KeyOptions | Yes| Callback used to return the result.<br> When a key input event that meets the specified options occurs, **keyOptions** will be passed as an input parameter to **callback**.|
| callback | Callback<KeyOptions> | Yes| Callback used to return the result.<br> When a key input event that meets the specified options occurs, **keyOptions** will be passed as an input parameter to **callback**.|
The input device management module is used to listen for the connection, disconnection, and updates of input devices and display information about input devices. For example, it can be used to listen for mouse insertion and removal and obtain information such as the ID, name, and pointer speed of the mouse.
The Input Device module implements listening for connection, disconnection, and update events of input devices and displays information about input devices. For example, it can be used to listen for mouse insertion and removal and obtain information such as the ID, name, and pointer speed of the mouse.
The Input Event module describes basic events reported by an input device.
> **NOTE**<br>
> **NOTE**<br>
> 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.
> 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.
The Key Injection module implements injection of key events.
> **NOTE**<br>
> **NOTE**<br>
>
>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> - The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
>
> The APIs of this module are system APIs and cannot be called by third-party applications.
> - The APIs of this module are system APIs and cannot be called by third-party applications.
The Input Monitor module implements listening for global touch events.
> **NOTE**<br>
> **NOTE**<br>
> - The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> - The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
| type | string | Yes | Type of the input event to listen for. The value is **mouse**.|
| type | string | Yes | Type of the input event to listen for. The value is **mouse**.|
| receiver | Callback<MouseEvent> | No | Callback used to return the mouse event. |
| receiver | Callback<MouseEvent> | No | Callback used to return the mouse event. |
**Example**
**Example**
...
@@ -119,12 +128,9 @@ inputMonitor.off("mouse");
...
@@ -119,12 +128,9 @@ inputMonitor.off("mouse");
## TouchEventReceiver
## TouchEventReceiver
This class provides the callback of touch events.
Provides the callback of touch events.
### (touchEvent: TouchEvent): Boolean
Represents the callback used to return the touch event. You need to define the name of the callback function in the correct format. Ensure that the input parameter is of the **TouchEvent** type, and the return value is of the **Boolean** type.
The Keycode module provides keycodes for a key device.
> **NOTE**<br>
> **NOTE**<br>
> 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.
> 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.
...
@@ -11,6 +11,8 @@ Provides keycodes for a key device.
...
@@ -11,6 +11,8 @@ Provides keycodes for a key device.
Represents key events reported by an input device.
The Key Event module provides key events reported by an input device.
> **NOTE**<br>
> **NOTE**<br>
> 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.
> 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.