未验证 提交 f9a5d421 编写于 作者: O openharmony_ci 提交者: Gitee

!5614 翻译已完成5149

Merge pull request !5614 from shawn_he/5149-b
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
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 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.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > **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.
## Modules to Import ## Modules to Import
``` ```js
import inputDevice from '@ohos.multimodalInput.inputDevice'; import inputDevice from '@ohos.multimodalInput.inputDevice';
``` ```
...@@ -33,7 +33,7 @@ Obtains the IDs of all input devices. This API uses an asynchronous callback to ...@@ -33,7 +33,7 @@ Obtains the IDs of all input devices. This API uses an asynchronous callback to
**Example** **Example**
``` ```js
export default { export default {
data: { data: {
deviceIds: Array, deviceIds: Array,
...@@ -51,7 +51,7 @@ export default { ...@@ -51,7 +51,7 @@ export default {
## inputDevice.getDeviceIds ## inputDevice.getDeviceIds
function getDeviceIds(): Promise<Array<number>> function getDeviceIds(): Promise<Array\<number>>
Obtains the IDs of all input devices. This API uses a promise to return the result. Obtains the IDs of all input devices. This API uses a promise to return the result.
...@@ -59,13 +59,13 @@ Obtains the IDs of all input devices. This API uses a promise to return the resu ...@@ -59,13 +59,13 @@ Obtains the IDs of all input devices. This API uses a promise to return the resu
**Return value** **Return value**
| Name | Description | | Parameter | Description |
| ---------------------- | ------------------ | | ---------------------- | ------------------ |
| Promise<Array<number>> | Promise used to return the result.| | Promise<Array\<number>> | Promise used to return the result.|
**Example** **Example**
``` ```js
export default { export default {
testGetDeviceIds: function () { testGetDeviceIds: function () {
console.info("InputDeviceJsTest---start---testGetDeviceIds"); console.info("InputDeviceJsTest---start---testGetDeviceIds");
...@@ -100,7 +100,7 @@ Obtains the information about an input device. This API uses an asynchronous cal ...@@ -100,7 +100,7 @@ Obtains the information about an input device. This API uses an asynchronous cal
**Example** **Example**
``` ```js
export default { export default {
InputDeviceData: { InputDeviceData: {
deviceId : 0, deviceId : 0,
...@@ -122,7 +122,7 @@ export default { ...@@ -122,7 +122,7 @@ export default {
## inputDevice.getDevice ## inputDevice.getDevice
function getDevice(deviceId: number): Promise<InputDeviceData> function getDevice(deviceId: number): Promise\<InputDeviceData>
Obtains the information about an input device. This API uses a promise to return the result. Obtains the information about an input device. This API uses a promise to return the result.
...@@ -130,13 +130,13 @@ Obtains the information about an input device. This API uses a promise to return ...@@ -130,13 +130,13 @@ Obtains the information about an input device. This API uses a promise to return
**Return value** **Return value**
| Name | Description | | Parameter | Description |
| ------------------------ | ------------------ | | ------------------------ | ------------------ |
| Promise<InputDeviceData> | Promise used to return the result.| | Promise\<InputDeviceData> | Promise used to return the result.|
**Example** **Example**
``` ```js
export default { export default {
InputDeviceData: { InputDeviceData: {
deviceId : 0, deviceId : 0,
...@@ -165,15 +165,22 @@ Defines the information about an input device. ...@@ -165,15 +165,22 @@ Defines the information about an input device.
**System capability**: SystemCapability.MultimodalInput.Input.InputDevice **System capability**: SystemCapability.MultimodalInput.Input.InputDevice
| Name | Type | Description | | Name | Type | Description |
| ------- | -------------------------------------- | ---------------------------------------- | | ---------- | -------------------------- | ---------------------------------------------------- |
| id | number | Unique identifier of an input device. If the same physical device is repeatedly inserted and removed, its ID changes. | | id | number | Unique identifier of an input device. If the same physical device is repeatedly inserted and removed, its ID changes. |
| name | string | Name of the input device. | | name | string | Name of the input device. |
| sources | Array&lt;[SourceType](#sourcetype)&gt; | Source types of the input device. For example, if a keyboard is attached with a touchpad, the device has two input sources: keyboard and touchpad.| | sources | Array&lt;[SourceType](#sourcetype)&gt; | Source types of the input device. For example, if a keyboard is attached with a touchpad, the device has two input sources: keyboard and touchpad. |
| axisRanges | Array&lt;[axisRanges](#axisrange)&gt; | Axis information of the input device. |
| bus | number | Bus type of the input device. |
| product | number | Product information of the input device. |
| vendor | number | Vendor information of the input device. |
| version | number | Version information of the input device. |
| phys | string | Physical address of the input device. |
| uniq | string | Unique ID of the input device. |
## AxisType ## AxisType
Axis type. This API is defined but not implemented in OpenHarmony 3.1 Release. It will be available for use in OpenHarmony 3.1 MR. Defines the axis type of an input device, which is **NULL**.
## AxisRange ## AxisRange
......
# Input Event Client # Input Event Client
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > **NOTE**
> >
> - 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.
## Modules to Import ## Modules to Import
``` ```js
import inputEventClient from '@ohos.multimodalInput.inputEventClient'; import inputEventClient from '@ohos.multimodalInput.inputEventClient';
``` ```
...@@ -32,14 +32,14 @@ Injects a key. ...@@ -32,14 +32,14 @@ Injects a key.
**Example** **Example**
``` ```js
let keyEvent = { let keyEvent = {
isPressed: true, isPressed: true,
keyCode: 2, keyCode: 2,
keyDownDuration: 0, keyDownDuration: 0,
isIntercepted: false isIntercepted: false
} }
res = inputEventClient.injectEvent({KeyEvent: keyEvent}); let res = inputEventClient.injectEvent({KeyEvent: keyEvent});
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册