From 04d3a25d232e708aa68d67122003b55b4ea184f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=B5=B7=E5=B3=B0?= Date: Tue, 22 Nov 2022 02:54:22 +0000 Subject: [PATCH 1/2] =?UTF-8?q?api=E6=96=87=E6=A1=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张海峰 Change-Id: Ia0fc88c039dae1cc0a7cdd24e81d016a5e76e399 --- .../reference/apis/js-apis-cooperate.md | 30 ++-- .../reference/apis/js-apis-inputconsumer.md | 16 +- .../reference/apis/js-apis-inputdevice.md | 140 +++++++++--------- .../reference/apis/js-apis-inputevent.md | 2 +- .../apis/js-apis-inputeventclient.md | 14 +- .../reference/apis/js-apis-inputmonitor.md | 38 +++-- .../reference/apis/js-apis-keycode.md | 2 +- .../reference/apis/js-apis-keyevent.md | 6 +- .../reference/apis/js-apis-mouseevent.md | 10 +- .../reference/apis/js-apis-pointer.md | 20 ++- .../reference/apis/js-apis-touchevent.md | 10 +- 11 files changed, 155 insertions(+), 133 deletions(-) diff --git a/zh-cn/application-dev/reference/apis/js-apis-cooperate.md b/zh-cn/application-dev/reference/apis/js-apis-cooperate.md index 3e01d5ba834..f6dc0828fa6 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-cooperate.md +++ b/zh-cn/application-dev/reference/apis/js-apis-cooperate.md @@ -4,7 +4,9 @@ > **说明** > -> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 +> - 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 +> +> - 本模块接口均为系统接口。 ## 导入模块 @@ -18,7 +20,7 @@ enable(enable: boolean, callback: AsyncCallback<void>): void 开启、关闭键鼠穿越,使用AsyncCallback异步方式返回结果。 -**系统能力**: SystemCapability.MultimodalInput.Input.InputDeviceCooperate +**系统能力**: SystemCapability.MultimodalInput.Input.Cooperate **参数**: @@ -52,7 +54,7 @@ enable(enable: boolean): Promise<void> 开启、关闭键鼠穿越,使用Promise异步方式返回结果。 -**系统能力**: SystemCapability.MultimodalInput.Input.InputDeviceCooperate +**系统能力**: SystemCapability.MultimodalInput.Input.Cooperate **参数**: @@ -90,7 +92,7 @@ start(sinkDeviceDescriptor: string, srcInputDeviceId: number, callback: AsyncCal 启动键鼠穿越,使用AsyncCallback异步方式返回结果。 -**系统能力**:SystemCapability.MultimodalInput.Input.InputDeviceCooperate +**系统能力**:SystemCapability.MultimodalInput.Input.Cooperate **参数**: @@ -131,7 +133,7 @@ start(sinkDeviceDescriptor: string, srcInputDeviceId: number): Promise\ 启动键鼠穿越,使用Promise异步方式返回结果。 -**系统能力**: SystemCapability.MultimodalInput.Input.InputDeviceCooperate +**系统能力**: SystemCapability.MultimodalInput.Input.Cooperate **参数**: @@ -177,7 +179,7 @@ stop(callback: AsyncCallback\): void 停止键鼠穿越,使用AsyncCallback异步方式返回结果。 -**系统能力**:SystemCapability.MultimodalInput.Input.InputDeviceCooperate +**系统能力**:SystemCapability.MultimodalInput.Input.Cooperate **参数**: @@ -209,9 +211,9 @@ stop(): Promise\ 停止键鼠穿越,使用Promise异步方式返回结果。 -**系统能力**:SystemCapability.MultimodalInput.Input.InputDeviceCooperate +**系统能力**:SystemCapability.MultimodalInput.Input.Cooperate -**参数**: +**返回值**: | 参数名 | 说明 | | -------- | ---------------------------- | @@ -237,7 +239,7 @@ getState(deviceDescriptor: string, callback: AsyncCallback<{ state: boolean }>): 获取键鼠穿越开关的状态,使用AsyncCallback异步方式返回结果。 -**系统能力**:SystemCapability.MultimodalInput.Input.InputDeviceCooperate +**系统能力**:SystemCapability.MultimodalInput.Input.Cooperate **参数**: @@ -268,7 +270,7 @@ getState(deviceDescriptor: string): Promise<{ state: boolean }> 获取键鼠穿越开关的状态,使用Promise异步方式返回结果。 -**系统能力**:SystemCapability.MultimodalInput.Input.InputDeviceCooperate +**系统能力**:SystemCapability.MultimodalInput.Input.Cooperate **参数**: @@ -306,7 +308,7 @@ on(type: 'cooperation', callback: AsyncCallback<{ deviceDescriptor: string, even 注册监听键鼠穿越状态。 -**系统能力**:SystemCapability.MultimodalInput.Input.InputDeviceCooperate +**系统能力**:SystemCapability.MultimodalInput.Input.Cooperate **参数**: @@ -335,7 +337,7 @@ off(type: 'cooperation', callback?: AsyncCallback\): void 关闭监听键鼠穿越状态。 -**系统能力**:SystemCapability.MultimodalInput.Input.InputDeviceCooperate +**系统能力**:SystemCapability.MultimodalInput.Input.Cooperate **参数**: @@ -379,9 +381,9 @@ try { 键鼠穿越事件。 -**系统能力**:SystemCapability.MultimodalInput.Input.InputDeviceCooperate +**系统能力**:SystemCapability.MultimodalInput.Input.Cooperate -| 参数名 | 值 | 说明 | +| 名称 | 值 | 说明 | | -------- | --------- | ----------------- | | MSG_COOPERATE_INFO_START | 200 | 键鼠穿越消息,表示键鼠穿越开始。 | | MSG_COOPERATE_INFO_SUCCESS | 201 | 键鼠穿越消息,表示键鼠穿越成功。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inputconsumer.md b/zh-cn/application-dev/reference/apis/js-apis-inputconsumer.md index 7f9be5cf41f..11da53c8110 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-inputconsumer.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inputconsumer.md @@ -27,7 +27,7 @@ on(type: "key", keyOptions: KeyOptions, callback: Callback<KeyOptions>): v **参数:** -| 参数 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | ---------- | -------------------------- | ---- | ---------------------------------------- | | type | string | 是 | 事件类型,目前只支持”key“。 | | keyOptions | [keyOptions](#keyoptions) | 是 | 组合键选项。 | @@ -58,7 +58,7 @@ off(type: "key", keyOptions: KeyOptions, callback?: Callback<KeyOptions>): **参数:** -| 参数 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | ---------- | -------------------------- | ---- | ------------------------------- | | type | string | 是 | 事件类型,当前只支持”key“。 | | keyOptions | [keyOptions](#keyoptions) | 是 | 组合键选项。 | @@ -106,9 +106,9 @@ try { **系统能力:** SystemCapability.MultimodalInput.Input.InputConsumer -| 参数 | 类型 | 必填 | 说明 | -| -------------------- | ------- | ---- | ------------------------ | -| preKeys | Array | 是 | 前置按键集合,数量范围[0, 4],前置按键无顺序要求。 | -| finalKey | Number | 是 | 最终按键,此项必填,最终按键触发上报回调函数。 | -| isFinalKeyDown | boolean | 是 | 最终按键状态。 | -| finalKeyDownDuration | Number | 是 | 最终按键保持按下持续时间,为0时立即触发回调函数,大于0时,当isFinalKeyDown为true,则最终按键按下超过此时长后触发回调函数,当isFinalKeyDown为false,则最终按键按下到抬起时间小于此时长时触发回调函数。 | +| 名称 | 类型 | 可读 | 可写 | 说明 | +| --------- | ------ | ---- | ---- | ------- | +| preKeys | Array | 是 | 否 | 前置按键集合,数量范围[0, 4],前置按键无顺序要求。 | +| finalKey | Number | 是 | 否 | 最终按键,此项必填,最终按键触发上报回调函数。 | +| isFinalKeyDown | boolean | 是 | 否 | 最终按键状态。 | +| finalKeyDownDuration | Number | 是 | 否 | 最终按键保持按下持续时间,为0时立即触发回调函数,大于0时,当isFinalKeyDown为true,则最终按键按下超过此时长后触发回调函数,当isFinalKeyDown为false,则最终按键按下到抬起时间小于此时长时触发回调函数。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inputdevice.md b/zh-cn/application-dev/reference/apis/js-apis-inputdevice.md index ecd2d4b1968..ac07ec371f5 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-inputdevice.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inputdevice.md @@ -26,7 +26,7 @@ getDeviceList(callback: AsyncCallback<Array<number>>): void **参数**: -| 参数 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------------------------- | ---- | ---------------------------------------- | | callback | AsyncCallback<Array<number>> | 是 | 回调函数,异步返回所有输入设备的id列表。 | @@ -82,7 +82,7 @@ getDeviceInfo(deviceId: number, callback: AsyncCallback<InputDeviceData>): **参数**: -| 参数 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | -------------------------------------------------------- | ---- | --------------------------------------- | | deviceId | number | 是 | 输入设备id。 | | callback | AsyncCallback<[InputDeviceData](#inputdevicedata)> | 是 | 回调函数,异步返回输入设备信息。 | @@ -114,7 +114,7 @@ getDeviceInfo(deviceId: number): Promise<InputDeviceData> **参数**: -| 参数 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ------ | ---- | ---------------------- | | deviceId | number | 是 | 输入设备id。 | @@ -147,7 +147,7 @@ on(type: "change", listener: Callback<DeviceListener>): void **参数**: -| 参数 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------------------------- | ---- | ----------- | | type | string | 是 | 输入设备的事件类型。 | | listener | Callback<[DeviceListener](#devicelistener9)> | 是 | 回调函数,异步上报输入设备热插拔事件。 | @@ -186,7 +186,7 @@ off(type: "change", listener?: Callback<DeviceListener>): void **参数**: -| 参数 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------------------------- | ---- | ----------- | | type | string | 是 | 输入设备的事件类型。 | | listener | Callback<[DeviceListener](#devicelistener9)> | 否 | 取消监听的回调函数。 | @@ -231,7 +231,7 @@ getDeviceIds(callback: AsyncCallback<Array<number>>): void **参数**: -| 参数 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------------------------- | ---- | ---------------------------------------- | | callback | AsyncCallback<Array<number>> | 是 | 回调函数,异步返回所有输入设备的id列表。 | @@ -283,7 +283,7 @@ getDevice(deviceId: number, callback: AsyncCallback<InputDeviceData>): voi **参数**: -| 参数 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | -------------------------------------------------------- | ---- | -------------------------------- | | deviceId | number | 是 | 输入设备id。 | | callback | AsyncCallback<[InputDeviceData](#inputdevicedata)> | 是 | 回调函数,异步返回输入设备信息。 | @@ -313,7 +313,7 @@ getDevice(deviceId: number): Promise<InputDeviceData> **参数**: -| 参数 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ------ | ---- | ------------ | | deviceId | number | 是 | 输入设备id。 | @@ -342,7 +342,7 @@ supportKeys(deviceId: number, keys: Array<KeyCode>, callback: Callback< **参数**: -| 参数 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------ | ---- | ------------------------------------------------------ | | deviceId | number | 是 | 输入设备id,同一个物理设备反复插拔,设备id会发生变化。 | | keys | Array<KeyCode> | 是 | 需要查询的键码值,最多支持5个按键查询。 | @@ -371,7 +371,7 @@ supportKeys(deviceId: number, keys: Array<KeyCode>): Promise<Array<b **参数**: -| 参数 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | -------------------- | ---- | ------------------------------------------------------ | | deviceId | number | 是 | 输入设备id,同一个物理设备反复插拔,设备id会发生变化。 | | keys | Array<KeyCode> | 是 | 需要查询的键码值,最多支持5个按键查询。 | @@ -405,7 +405,7 @@ getKeyboardType(deviceId: number, callback: AsyncCallback<KeyboardType>): **参数**: -| 参数 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | --------------------------------------------------- | ---- | ------------------------------------------------------------ | | deviceId | number | 是 | 输入设备的唯一标识,同一个物理设备反复插拔,设备id会发生变化。 | | callback | AsyncCallback<[KeyboardType](#keyboardtype9)> | 是 | 回调函数,异步返回查询结果。 | @@ -437,7 +437,7 @@ getKeyboardType(deviceId: number): Promise<KeyboardType> **参数**: -| 参数 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ------ | ---- | ------------------------------------------------------------ | | deviceId | number | 是 | 输入设备的唯一标识,同一个物理设备反复插拔,设备id会发生变化。 | @@ -466,10 +466,10 @@ try { **系统能力**:SystemCapability.MultimodalInput.Input.InputDevice -| 名称 | 参数类型 | 说明 | -| -------- | --------------------------- | ------------------------------------------------------------ | -| type | [ChangedType](#changedtype) | 输入设备插入或者移除。 | -| deviceId | number | 输入设备的唯一标识,同一个物理设备反复插拔,设备id会发生变化。 | +| 名称 | 类型 | 可读 | 可写 | 说明 | +| --------- | ------ | ---- | ---- | ------- | +| type | [ChangedType](#changedtype) | 是 | 否 | 输入设备插入或者移除。| +| deviceId | number | 是 | 否 | 输入设备的唯一标识,同一个物理设备反复插拔,设备id会发生变化。 | ## InputDeviceData @@ -477,18 +477,18 @@ try { **系统能力**:SystemCapability.MultimodalInput.Input.InputDevice -| 名称 | 参数类型 | 说明 | -| -------------------- | -------------------------------------- | ------------------------------------------------------------ | -| id | number | 输入设备的唯一标识,同一个物理设备反复插拔,设备id会发生变化。 | -| name | string | 输入设备的名字。 | -| sources | Array<[SourceType](#sourcetype)> | 输入设备支持的源类型。比如有的键盘上附带触摸板,则此设备有keyboard和touchpad两种输入源。 | -| axisRanges | Array<[axisRanges](#axisrange)> | 输入设备的轴信息。 | -| bus9+ | number | 输入设备的总线类型。 | -| product9+ | number | 输入设备的产品信息。 | -| vendor9+ | number | 输入设备的厂商信息。 | -| version9+ | number | 输入设备的版本信息。 | -| phys9+ | string | 输入设备的物理地址。 | -| uniq9+ | string | 输入设备的唯一标识。 | +| 名称 | 类型 | 可读 | 可写 | 说明 | +| --------- | ------ | ---- | ---- | ------- | +| id | number | 是 | 否 | 输入设备的唯一标识,同一个物理设备反复插拔,设备id会发生变化。 | +| name | string | 是 | 否 | 输入设备的名字。 | +| sources | Array<[SourceType](#sourcetype)> | 是 | 否 | 输入设备支持的源类型。比如有的键盘上附带触摸板,则此设备有keyboard和touchpad两种输入源。 | +| axisRanges | Array<[axisRanges](#axisrange)> | 是 | 否 | 输入设备的轴信息。 | +| bus9+ | number | 是 | 否 | 输入设备的总线类型。 | +| product9+ | number | 是 | 否 | 输入设备的产品信息。 | +| vendor9+ | number | 是 | 否 | 输入设备的厂商信息。 | +| version9+ | number | 是 | 否 | 输入设备的版本信息。 | +| phys9+ | string | 是 | 否 | 输入设备的物理地址。 | +| uniq9+ | string | 是 | 否 | 输入设备的唯一标识。 | ## AxisType9+ @@ -496,17 +496,17 @@ try { **系统能力**:SystemCapability.MultimodalInput.Input.InputDevice -| 名称 | 参数类型 | 说明 | -| ----------- | ------ | --------------- | -| touchMajor | string | 表示touchMajor轴。 | -| touchMinor | string | 表示touchMinor轴。 | -| toolMinor | string | 表示toolMinor轴。 | -| toolMajor | string | 表示toolMajor轴。 | -| orientation | string | 表示orientation轴。 | -| pressure | string | 表示pressure轴。 | -| x | string | 表示x轴。 | -| y | string | 表示y轴。 | -| NULL | string | 无。 | +| 名称 | 类型 | 可读 | 可写 | 说明 | +| --------- | ------ | ---- | ---- | ------- | +| touchMajor | string | 是 | 否 | 表示touchMajor轴。 | +| touchMinor | string | 是 | 否 | 表示touchMinor轴。 | +| toolMinor | string | 是 | 否 | 表示toolMinor轴。 | +| toolMajor | string | 是 | 否 | 表示toolMajor轴。 | +| orientation | string | 是 | 否 | 表示orientation轴。 | +| pressure | string | 是 | 否 | 表示pressure轴。 | +| x | string | 是 | 否 | 表示x轴。 | +| y | string | 是 | 否 | 表示y轴。 | +| NULL | string | 是 | 否 | 无。 | ## AxisRange @@ -514,41 +514,41 @@ try { **系统能力**: SystemCapability.MultimodalInput.Input.InputDevice -| 名称 | 参数类型 | 说明 | -| ----------------------- | ------------------------- | -------- | -| source | [SourceType](#sourcetype) | 轴的输入源类型。 | -| axis | [AxisType](#axistype9) | 轴的类型。 | -| max | number | 轴的最大值。 | -| min | number | 轴的最小值。 | -| fuzz9+ | number | 轴的模糊值。 | -| flat9+ | number | 轴的基准值。 | -| resolution9+ | number | 轴的分辨率。 | +| 名称 | 类型 | 可读 | 可写 | 说明 | +| --------- | ------ | ---- | ---- | ------- | +| source | [SourceType](#sourcetype) | 是 | 否 | 轴的输入源类型。 | +| axis | [AxisType](#axistype9) | 是 | 否 | 轴的类型。 | +| max | number | 是 | 否 | 轴的最大值。 | +| min | number | 是 | 否 | 轴的最小值。 | +| fuzz9+ | number | 是 | 否 | 轴的模糊值。 | +| flat9+ | number | 是 | 否 | 轴的基准值。 | +| resolution9+ | number | 是 | 否 | 轴的分辨率。 | -## SourceType +## SourceType9+ 轴的输入源类型。比如鼠标设备可上报x轴事件,则x轴的输入源就是鼠标。 **系统能力**:SystemCapability.MultimodalInput.Input.InputDevice -| 名称 | 参数类型 | 说明 | -| ----------- | ------ | ----------- | -| keyboard | string | 表示输入设备是键盘。 | -| touchscreen | string | 表示输入设备是触摸屏。 | -| mouse | string | 表示输入设备是鼠标。 | -| trackball | string | 表示输入设备是轨迹球。 | -| touchpad | string | 表示输入设备是触摸板。 | -| joystick | string | 表示输入设备是操纵杆。 | +| 名称 | 类型 | 可读 | 可写 | 说明 | +| --------- | ------ | ---- | ---- | ------- | +| keyboard | string | 是 | 否 | 表示输入设备是键盘。 | +| touchscreen | string | 是 | 否 | 表示输入设备是触摸屏。 | +| mouse | string | 是 | 否 | 表示输入设备是鼠标。 | +| trackball | string | 是 | 否 | 表示输入设备是轨迹球。 | +| touchpad | string | 是 | 否 | 表示输入设备是触摸板。 | +| joystick | string | 是 | 否 | 表示输入设备是操纵杆。 | -## ChangedType +## ChangedType9+ 定义监听设备热插拔事件。 **系统能力**:SystemCapability.MultimodalInput.Input.InputDevice -| 名称 | 参数类型 | 说明 | -| ------ | ------ | --------- | -| add | string | 表示输入设备插入。 | -| remove | string | 表示输入设备移除。 | +| 名称 | 类型 | 可读 | 可写 | 说明 | +| --------- | ------ | ---- | ---- | ------- | +| add | string | 是 | 否 | 表示输入设备插入。 | +| remove | string | 是 | 否 | 表示输入设备移除。 | ## KeyboardType9+ @@ -556,11 +556,11 @@ try { **系统能力**:SystemCapability.MultimodalInput.Input.InputDevice -| 名称 | 参数类型 | 值 | 说明 | -| ------------------- | ------ | ---- | --------- | -| NONE | number | 0 | 表示无按键设备。 | -| UNKNOWN | number | 1 | 表示未知按键设备。 | -| ALPHABETIC_KEYBOARD | number | 2 | 表示全键盘设备。 | -| DIGITAL_KEYBOARD | number | 3 | 表示小键盘设备。 | -| HANDWRITING_PEN | number | 4 | 表示手写笔设备。 | -| REMOTE_CONTROL | number | 5 | 表示遥控器设备。 | +| 名称 | 值 | 说明 | +| ------------------- | ---- | --------- | +| NONE | 0 | 表示无按键设备。 | +| UNKNOWN | 1 | 表示未知按键设备。 | +| ALPHABETIC_KEYBOARD | 2 | 表示全键盘设备。 | +| DIGITAL_KEYBOARD | 3 | 表示小键盘设备。 | +| HANDWRITING_PEN | 4 | 表示手写笔设备。 | +| REMOTE_CONTROL | 5 | 表示遥控器设备。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inputevent.md b/zh-cn/application-dev/reference/apis/js-apis-inputevent.md index 1d964e6d0ba..b5367dcf090 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-inputevent.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inputevent.md @@ -15,7 +15,7 @@ import InputEvent from '@ohos.multimodalInput.inputEvent'; **系统能力**:SystemCapability.MultimodalInput.Input.Core -| 名称 | 参数类型 | 可读 | 可写 | 描述 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | ---------- | ------ | ---- | ---- | -------------- | | id | number | 是 | 否 | 事件id | | deviceId | number | 是 | 否 | 上报输入事件的设备id | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inputeventclient.md b/zh-cn/application-dev/reference/apis/js-apis-inputeventclient.md index 80d1a26688e..41e85e439bf 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-inputeventclient.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inputeventclient.md @@ -27,7 +27,7 @@ injectEvent({KeyEvent: KeyEvent}): void **参数:** -| 参数 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | --------------------- | ---- | --------- | | KeyEvent | [KeyEvent](#keyevent) | 是 | 按键注入描述信息。 | @@ -62,10 +62,10 @@ try { **系统能力:** SystemCapability.MultimodalInput.Input.InputSimulator -| 参数 | 类型 | 必填 | 说明 | -| --------------- | ------- | ---- | -------------------------- | -| isPressed | boolean | 是 | 按键是否按下。 | -| keyCode | number | 是 | 按键键值,当前只支持back键。 | -| keyDownDuration | number | 是 | 按键按下持续时间。 | -| isIntercepted | boolean | 是 | 按键是否可以被拦截。 | +| 名称 | 类型 | 可读 | 可写 | 说明 | +| --------- | ------ | ---- | ---- | ------- | +| isPressed | boolean | 是 | 否 | 按键是否按下。 | +| keyCode | number | 是 | 否 | 按键键值,当前只支持back键。 | +| keyDownDuration | number | 是 | 否 | 按键按下持续时间。 | +| isIntercepted | boolean | 是 | 否 | 按键是否可以被拦截。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inputmonitor.md b/zh-cn/application-dev/reference/apis/js-apis-inputmonitor.md index 242b63a32ab..f964be51c1b 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-inputmonitor.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inputmonitor.md @@ -1,6 +1,7 @@ # 输入监听 输入监听模块,提供了监听输入设备事件(当前支持触摸屏和鼠标)的能力。 + > **说明:** > > - 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 @@ -22,17 +23,20 @@ on(type: "touch", receiver: TouchEventReceiver): void 开始监听全局触屏事件。 +**系统接口:** 此接口为系统接口。 + **需要权限:** ohos.permission.INPUT_MONITORING **系统能力:** SystemCapability.MultimodalInput.Input.InputMonitor - **参数:** -| 参数 | 类型 | 必填 | 说明 | +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------------------------- | ---- | ------------------- | | type | string | 是 | 输入设备事件类型,取值“touch”。 | | receiver | [TouchEventReceiver](#toucheventreceiver) | 是 | 回调函数,异步上报触摸屏输入事件。 | - **示例:** +**示例:** ```js try { @@ -45,18 +49,21 @@ try { } ``` +## inputMonitor.on9+ on(type: "mouse", receiver: Callback<MouseEvent>): void 开始监听全局鼠标事件。 +**系统接口:** 此接口为系统接口。 + **需要权限:** ohos.permission.INPUT_MONITORING **系统能力:** SystemCapability.MultimodalInput.Input.InputMonitor - **参数:** +**参数:** -| 参数 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | -------------------------- | ---- | ------------------- | | type | string | 是 | 输入设备事件类型,取值“mouse”。 | | receiver | Callback<MouseEvent> | 是 | 回调函数,异步上报鼠标输入事件。 | @@ -86,13 +93,14 @@ off(type: "touch", receiver?: TouchEventReceiver): void **系统能力:** SystemCapability.MultimodalInput.Input.InputMonitor - **参数:** -| 参数 | 类型 | 必填 | 说明 | +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------------------------- | ---- | ------------------- | | type | string | 是 | 输入设备事件类型,取值“touch”。 | | receiver | [TouchEventReceiver](#toucheventreceiver) | 否 | 需要取消监听的回调函数,若无此参数,则取消当前应用监听的所有回调函数。 | - **示例:** +**示例:** ```js // 取消监听单个回调函数 @@ -124,6 +132,8 @@ try { } ``` +## inputMonitor.off9+ + off(type: "mouse", receiver?: Callback<MouseEvent>): void 停止监听全局鼠标事件。 @@ -132,9 +142,9 @@ off(type: "mouse", receiver?: Callback<MouseEvent>): void **系统能力:** SystemCapability.MultimodalInput.Input.InputMonitor - **参数:** +**参数:** -| 参数 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | -------------------------- | ---- | ------------------- | | type | string | 是 | 输入设备事件类型,取值“mouse”。 | | receiver | Callback<MouseEvent> | 否 | 需要取消监听的回调函数,若无此参数,则取消当前应用监听的所有回调函数。 | @@ -179,17 +189,19 @@ try { **系统能力:** SystemCapability.MultimodalInput.Input.InputMonitor - **参数:** +**参数:** + | 参数 | 类型 | 必填 | 说明 | | ---------- | ---------------------------------------- | ---- | ---------------------------------------- | | touchEvent | [TouchEvent](../arkui-js/js-components-common-events.md) | 是 | 触摸输入事件。 | - **返回值:** +**返回值:** + | 类型 | 说明 | | ------- | ---------------------------------------- | | Boolean | 若返回true,本次触摸后续产生的事件不再分发到窗口;若返回false,本次触摸后续产生的事件还会分发到窗口。 | - **示例:** +**示例:** ```js try { diff --git a/zh-cn/application-dev/reference/apis/js-apis-keycode.md b/zh-cn/application-dev/reference/apis/js-apis-keycode.md index 150356c791a..817111a4877 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-keycode.md +++ b/zh-cn/application-dev/reference/apis/js-apis-keycode.md @@ -15,7 +15,7 @@ import {KeyCode} from '@ohos.multimodalInput.keyCode'; **系统能力**:SystemCapability.MultimodalInput.Input.Core -| 名称 | 参数类型 | 可读 | 可写 | 描述 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | -------------------------------- | ------ | ---- | ---- | --------------------------- | | KEYCODE_FN | number | 是 | 否 | 功能(Fn)键 | | KEYCODE_UNKNOWN | number | 是 | 否 | 未知按键 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-keyevent.md b/zh-cn/application-dev/reference/apis/js-apis-keyevent.md index d1ac98a67ae..b1bf5553968 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-keyevent.md +++ b/zh-cn/application-dev/reference/apis/js-apis-keyevent.md @@ -16,7 +16,7 @@ import {Action, Key, KeyEvent} from '@ohos.multimodalInput.keyEvent'; **系统能力**:SystemCapability.MultimodalInput.Input.Core -| 名称 | 参数类型 | 可读 | 可写 | 描述 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | ------ | -------- | ---- | ---- | -------- | | CANCEL | number | 是 | 否 | 按键取消 | | DOWN | number | 是 | 否 | 按键按下 | @@ -26,7 +26,7 @@ import {Action, Key, KeyEvent} from '@ohos.multimodalInput.keyEvent'; **系统能力**:SystemCapability.MultimodalInput.Input.Core -| 名称 | 参数类型 | 可读 | 可写 | 描述 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | ----------- | -------- | ---- | ---- | -------------- | | code | KeyCode | 是 | 否 | 按键码 | | pressedTime | number | 是 | 否 | 按键按下时间 | @@ -36,7 +36,7 @@ import {Action, Key, KeyEvent} from '@ohos.multimodalInput.keyEvent'; **系统能力**:SystemCapability.MultimodalInput.Input.Core -| 名称 | 参数类型 | 可读 | 可写 | 描述 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | ----------- | -------- | ---- | ---- | ------------------------------ | | action | Action | 是 | 否 | 按键动作 | | key | Key | 是 | 否 | 当前上报的按键 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-mouseevent.md b/zh-cn/application-dev/reference/apis/js-apis-mouseevent.md index e576e6611dd..9df3148c907 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-mouseevent.md +++ b/zh-cn/application-dev/reference/apis/js-apis-mouseevent.md @@ -15,7 +15,7 @@ import {Action,Button,Axis,AxisValue,MouseEvent} from '@ohos.multimodalInput.mou **系统能力**:SystemCapability.MultimodalInput.Input.Core -| 名称 | 参数类型 | 可读 | 可写 | 描述 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | ----------- | -------- | ---- | ---- | -------------------- | | CANCEL | number | 是 | 否 | 取消 | | MOVE | number | 是 | 否 | 鼠标移动 | @@ -30,7 +30,7 @@ import {Action,Button,Axis,AxisValue,MouseEvent} from '@ohos.multimodalInput.mou **系统能力**:SystemCapability.MultimodalInput.Input.Core -| 名称 | 参数类型 | 可读 | 可写 | 描述 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | ------- | ------ | ---- | ---- | ----- | | LEFT | number | 是 | 否 | 鼠标左键 | | MIDDLE | number | 是 | 否 | 鼠标中键 | @@ -45,7 +45,7 @@ import {Action,Button,Axis,AxisValue,MouseEvent} from '@ohos.multimodalInput.mou **系统能力**:SystemCapability.MultimodalInput.Input.Core -| 名称 | 参数类型 | 可读 | 可写 | 描述 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | ----------------- | ------ | ---- | ---- | ----- | | SCROLL_VERTICAL | number | 是 | 否 | 垂直滚动轴 | | SCROLL_HORIZONTAL | number | 是 | 否 | 水平滚动轴 | @@ -56,7 +56,7 @@ import {Action,Button,Axis,AxisValue,MouseEvent} from '@ohos.multimodalInput.mou **系统能力**:SystemCapability.MultimodalInput.Input.Core -| 名称 | 参数类型 | 可读 | 可写 | 描述 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | ----- | ------ | ---- | ---- | ---- | | axis | Axis | 是 | 否 | 轴类型 | | value | number | 是 | 否 | 轴的值 | @@ -66,7 +66,7 @@ import {Action,Button,Axis,AxisValue,MouseEvent} from '@ohos.multimodalInput.mou **系统能力**:SystemCapability.MultimodalInput.Input.Core -| 名称 | 参数类型 | 可读 | 可写 | 描述 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | -------------- | ----------- | ---- | ---- | ---------------------------------------- | | action | Action | 是 | 否 | 鼠标事件动作 | | screenX | number | 是 | 否 | 鼠标光标在屏幕中的横坐标 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-pointer.md b/zh-cn/application-dev/reference/apis/js-apis-pointer.md index ca40808f648..4505b7803b9 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-pointer.md +++ b/zh-cn/application-dev/reference/apis/js-apis-pointer.md @@ -22,7 +22,7 @@ setPointerVisible(visible: boolean, callback: AsyncCallback<void>): void **参数**: -| 参数 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------- | ---- | ---------------------------------------- | | visible | boolean | 是 | 鼠标指针是否显示。 | | callback | AsyncCallback<void> | 是 | 回调函数。 | @@ -53,7 +53,7 @@ setPointerVisible(visible: boolean): Promise<void> **参数**: -| 参数 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | ------- | ------- | ---- | ---------------------------------------- | | visible | boolean | 是 | 鼠标指针是否显示。 | @@ -85,7 +85,7 @@ isPointerVisible(callback: AsyncCallback<boolean>): void **参数**: -| 参数 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------------- | ---- | -------------- | | callback | AsyncCallback<boolean> | 是 | 回调函数,异步返回鼠标指针显示或隐藏状态。 | @@ -135,9 +135,11 @@ setPointerSpeed(speed: number, callback: AsyncCallback<void>): void **系统能力**:SystemCapability.MultimodalInput.Input.Pointer +**系统API**: 此接口为系统接口。 + **参数**: -| 参数 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------- | ---- | ------------------------------------- | | speed | number | 是 | 鼠标移动速度,范围1-11,默认为5。 | | callback | AysncCallback<void> | 是 | 回调函数。 | @@ -166,9 +168,11 @@ setPointerSpeed(speed: number): Promise<void> **系统能力**:SystemCapability.MultimodalInput.Input.Pointer +**系统API**: 此接口为系统接口。 + **参数**: -| 参数 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | ----- | ------ | ---- | ----------------------------------- | | speed | number | 是 | 鼠标移动速度,范围1-11,默认为5。 | @@ -198,9 +202,11 @@ getPointerSpeed(callback: AsyncCallback<number>): void **系统能力**:SystemCapability.MultimodalInput.Input.Pointer +**系统API**: 此接口为系统接口。 + **参数**: -| 参数 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | --------------------------- | ---- | -------------- | | callback | AsyncCallback<number> | 是 | 回调函数,异步返回鼠标移动速度。 | @@ -228,6 +234,8 @@ getPointerSpeed(): Promise<number> **系统能力**:SystemCapability.MultimodalInput.Input.Pointer +**系统API**: 此接口为系统接口。 + **返回值**: | 参数 | 说明 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-touchevent.md b/zh-cn/application-dev/reference/apis/js-apis-touchevent.md index 59f8191cdf9..403cf5e7cec 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-touchevent.md +++ b/zh-cn/application-dev/reference/apis/js-apis-touchevent.md @@ -16,7 +16,7 @@ import {Action,ToolType,SourceType,Touch,TouchEvent} from '@ohos.multimodalInput **系统能力**:SystemCapability.MultimodalInput.Input.Core -| 名称 | 参数类型 | 可读 | 可写 | 描述 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | ------ | ------ | ---- | ---- | ---- | | CANCEL | number | 是 | 否 | 触摸取消 | | DOWN | number | 是 | 否 | 触摸按下 | @@ -27,7 +27,7 @@ import {Action,ToolType,SourceType,Touch,TouchEvent} from '@ohos.multimodalInput **系统能力**:SystemCapability.MultimodalInput.Input.Core -| 名称 | 参数类型 | 可读 | 可写 | 描述 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | -------- | ------ | ---- | ---- | ---- | | FINGER | number | 是 | 否 | 手指 | | PEN | number | 是 | 否 | 笔 | @@ -42,7 +42,7 @@ import {Action,ToolType,SourceType,Touch,TouchEvent} from '@ohos.multimodalInput **系统能力**:SystemCapability.MultimodalInput.Input.Core -| 名称 | 参数类型 | 可读 | 可写 | 描述 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | ------------ | ------ | ---- | ---- | ---- | | TOUCH_SCREEN | number | 是 | 否 | 触摸屏 | | PEN | number | 是 | 否 | 手写笔 | @@ -52,7 +52,7 @@ import {Action,ToolType,SourceType,Touch,TouchEvent} from '@ohos.multimodalInput **系统能力**:SystemCapability.MultimodalInput.Input.Core -| 名称 | 参数类型 | 可读 | 可写 | 描述 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | ----------- | ------ | ---- | ---- | ----------------------------------- | | id | number | 是 | 否 | 触摸事件标识 | | pressedTime | number | 是 | 否 | 按下时间戳 | @@ -77,7 +77,7 @@ import {Action,ToolType,SourceType,Touch,TouchEvent} from '@ohos.multimodalInput **系统能力**:SystemCapability.MultimodalInput.Input.Core -| 名称 | 参数类型 | 可读 | 可写 | 描述 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | ---------- | ---------- | ---- | ---- | --------- | | action | Action | 是 | 否 | 触摸动作 | | touch | Touch | 是 | 否 | 当前触摸点 | -- Gitee From cc33f0e15d5816650e34860ea4000e3d65139f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=B5=B7=E5=B3=B0?= Date: Tue, 22 Nov 2022 04:58:24 +0000 Subject: [PATCH 2/2] =?UTF-8?q?api=E6=96=87=E6=A1=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张海峰 Change-Id: I71473390d149c632a0a607d88e65e0ea91d2e1f1 --- zh-cn/application-dev/reference/apis/js-apis-pointer.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zh-cn/application-dev/reference/apis/js-apis-pointer.md b/zh-cn/application-dev/reference/apis/js-apis-pointer.md index 4505b7803b9..a967cea7ebf 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-pointer.md +++ b/zh-cn/application-dev/reference/apis/js-apis-pointer.md @@ -264,7 +264,7 @@ getPointerStyle(windowId: number, callback: AsyncCallback<PointerStyle>): **参数**: -| 参数 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------------------------- | ---- | -------------- | | windowId | number | 是 | 窗口id。 | | callback | AsyncCallback<[PointerStyle](#pointerstyle9)> | 是 | 回调函数,异步返回鼠标样式类型。 | @@ -302,7 +302,7 @@ getPointerStyle(windowId: number): Promise<PointerStyle> **参数**: -| 参数 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ------ | ---- | -------- | | windowId | number | 是 | 窗口id。 | @@ -345,7 +345,7 @@ setPointerStyle(windowId: number, pointerStyle: PointerStyle, callback: AsyncCal **参数**: -| 参数 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | ------------ | ------------------------------ | ---- | ----------------------------------- | | windowId | number | 是 | 窗口id。 | | pointerStyle | [PointerStyle](#pointerstyle9) | 是 | 鼠标样式id。 | @@ -383,7 +383,7 @@ setPointerStyle(windowId: number, pointerStyle: PointerStyle): Promise<void&g **参数**: -| 参数 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | ------------------- | ------------------------------ | ---- | ---------------- | | windowId | number | 是 | 窗口id。 | | pointerStyle | [PointerStyle](#pointerstyle9) | 是 | 鼠标样式id。 | -- Gitee