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

!5233 【OpenHarmony开源贡献者计划2022】【中文】inputdevice和inputmonitor api相关格式及表达问题

Merge pull request !5233 from king_he/0610-a
...@@ -19,7 +19,7 @@ import inputDevice from '@ohos.multimodalInput.inputDevice'; ...@@ -19,7 +19,7 @@ import inputDevice from '@ohos.multimodalInput.inputDevice';
on(type: “change”, listener: Callback<DeviceListener>): void on(type: “change”, listener: Callback<DeviceListener>): void
监听设备的热插拔事件。 监听输入设备的热插拔事件。
**系统能力**:SystemCapability.MultimodalInput.Input.InputDevice **系统能力**:SystemCapability.MultimodalInput.Input.InputDevice
...@@ -54,7 +54,7 @@ inputDevice.on("change", (data) => { ...@@ -54,7 +54,7 @@ inputDevice.on("change", (data) => {
off(type: “change”, listener?: Callback<DeviceListener>): void off(type: “change”, listener?: Callback<DeviceListener>): void
取消监听设备的热插拔事件。 取消监听输入设备的热插拔事件。
**系统能力**:SystemCapability.MultimodalInput.Input.InputDevice **系统能力**:SystemCapability.MultimodalInput.Input.InputDevice
...@@ -90,7 +90,7 @@ getDeviceIds(callback: AsyncCallback<Array<number>>): void ...@@ -90,7 +90,7 @@ getDeviceIds(callback: AsyncCallback<Array<number>>): void
**参数** **参数**
| 参数 | 类型 | 必填 | 说明 | | 参数 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | ----- | | -------- | ---------------------------------------- | ---- | ----- |
| callback | AsyncCallback<Array<number>> | 是 | 回调函数。 | | callback | AsyncCallback<Array<number>> | 是 | 回调函数。 |
...@@ -134,9 +134,9 @@ getDevice(deviceId: number, callback: AsyncCallback<InputDeviceData>): voi ...@@ -134,9 +134,9 @@ getDevice(deviceId: number, callback: AsyncCallback<InputDeviceData>): voi
**参数** **参数**
| 参数 | 类型 | 必填 | 说明 | | 参数 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------------------------- | | -------- | ---------------------------------------- | ---- | --------------------------- |
| deviceId | number | 是 | 需要获取信息的设备id。 | | deviceId | number | 是 | 需要获取信息的设备id。 |
| callback | AsyncCallback<[InputDeviceData](#inputdevicedata)> | 是 | 回调函数,异步返回InputDeviceData对象。 | | callback | AsyncCallback<[InputDeviceData](#inputdevicedata)> | 是 | 回调函数,异步返回InputDeviceData对象。 |
**示例** **示例**
...@@ -311,7 +311,7 @@ inputDevice.getKeyboardType(1).then((ret)=>{ ...@@ -311,7 +311,7 @@ inputDevice.getKeyboardType(1).then((ret)=>{
## AxisType<sup>9+</sup> ## AxisType<sup>9+</sup>
输入设备的轴类型 输入设备的轴类型
**系统能力**:以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.InputDevice **系统能力**:以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.InputDevice
...@@ -329,7 +329,7 @@ inputDevice.getKeyboardType(1).then((ret)=>{ ...@@ -329,7 +329,7 @@ inputDevice.getKeyboardType(1).then((ret)=>{
## AxisRange ## AxisRange
输入设备的轴信息 输入设备的轴信息
**系统能力**: 以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.InputDevice **系统能力**: 以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.InputDevice
......
...@@ -74,7 +74,7 @@ inputMonitor.off("mouse", (event) => { ...@@ -74,7 +74,7 @@ inputMonitor.off("mouse", (event) => {
off(type: "touch", receiver?:TouchEventReceiver):void off(type: "touch", receiver?:TouchEventReceiver):void
开始监听全局触屏事件。 停止监听全局触屏事件。
**需要权限:**ohos.permission.INPUT_MONITORING **需要权限:**ohos.permission.INPUT_MONITORING
...@@ -117,7 +117,7 @@ inputMonitor.off("mouse"); ...@@ -117,7 +117,7 @@ inputMonitor.off("mouse");
## TouchEventReceiver ## TouchEventReceiver
触摸输入事件的回调函数,如果返回true,则触摸输入将被监听器消耗(系统执行关闭动作) 触摸输入事件的回调函数。如果返回true,则触摸输入被监听器消耗,系统将执行关闭动作
### (touchEvent: TouchEvent): Boolean ### (touchEvent: TouchEvent): Boolean
...@@ -132,15 +132,15 @@ inputMonitor.off("mouse"); ...@@ -132,15 +132,15 @@ inputMonitor.off("mouse");
| touchEvent | [TouchEvent](../arkui-js/js-components-common-events.md) | 是 | 触摸输入事件回调函数,返回true表示输触事件被监听器消费,false表示输触事件未被监听器消费。 | | touchEvent | [TouchEvent](../arkui-js/js-components-common-events.md) | 是 | 触摸输入事件回调函数,返回true表示输触事件被监听器消费,false表示输触事件未被监听器消费。 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| ------- | -------------------------------------- | | ------- | -------------------------------------- |
| Boolean | 返回true表示输触事件被监听器消费,false表示输触事件未被监听器消费。 | | Boolean | 返回true表示触摸输入事件被监听器消费,false表示触摸输入事件未被监听器消费。 |
**示例:** **示例:**
```js ```js
inputMonitor.on("touch", (event) => { inputMonitor.on("touch", (event) => {
// 消费触事件 // 消费触摸输入事件
return false; return false;
}); });
inputMonitor.off("touch"); inputMonitor.off("touch");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册