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 c0c68148d5bb392952b47d24ebe56696d422664b..0a34cefa86bb57dfcac8a65484982ca413899405 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-inputconsumer.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inputconsumer.md @@ -1,5 +1,6 @@ # 组合按键 +InputConsumer模块提供对按键事件的监听。 > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > @@ -18,19 +19,19 @@ import inputConsumer from '@ohos.multimodalInput.inputConsumer'; ## inputConsumer.on -on(type: "key", keyOptions: KeyOptions, callback: Callback): void +on(type: "key", keyOptions: KeyOptions, callback: Callback<KeyOptions>): void 开始监听组合按键事件, 当满足条件的组合按键输入事件发生时,将keyOptions回调到入参callback表示的回调函数上。 -**系统能力:** SystemCapability.MultimodalInput.Input.InputConsumer +此接口为系统接口。 **参数:** -| 参数 | 类型 | 必填 | 说明 | +| 参数 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| type | string | 是 | 监听输入事件类型,只支持“key”。 | -| keyOptions | [keyOptions](#keyOptions) | 是 | 组合键选项,用来指定组合键输入时应该符合的条件。 | -| callback | KeyOptions | 是 | 回调函数。当满足条件的按键输入产生时,回调到此函数,以传入的KeyOptions为入参。 | +| type | string | 是 | 监听输入事件类型,只支持“key”。 | +| keyOptions | [keyOptions](#keyOptions) | 是 | 组合键选项,用来指定组合键输入时应该符合的条件。 | +| callback | Callback<KeyOptions> | 是 | 回调函数。当满足条件的按键输入产生时,回调到此函数,以传入的KeyOptions为入参。 | **示例:** @@ -46,19 +47,21 @@ inputConsumer.on('key', keyOptions, callback); ## inputConsumer.off -off(type: "key", keyOptions: KeyOptions, callback?: Callback): void +off(type: "key", keyOptions: KeyOptions, callback?: Callback<KeyOptions>): void 停止监听组合按键事件。 +此接口为系统接口。 + **系统能力:** SystemCapability.MultimodalInput.Input.InputConsumer **参数:** -| 参数 | 类型 | 必填 | 说明 | +| 参数 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| type | string | 是 | 监听输入事件类型,只支持“key”。 | -| keyOptions | [keyOptions](#keyOptions) | 是 | 开始监听时传入的keyOptions。 | -| callback | Callback | 是 | 开始监听时与KeyOption一同传入的回调函数 。 | +| type | string | 是 | 监听输入事件类型,只支持“key”。 | +| keyOptions | [keyOptions](#keyOptions) | 是 | 开始监听时传入的keyOptions。 | +| callback | Callback<KeyOptions> | 是 | 开始监听时与KeyOption一同传入的回调函数 。 | **示例:** @@ -76,7 +79,9 @@ inputConsumer.off('key', keyOptions, callback); 组合键输入事件发生时,组合键满足的选项。 -**系统能力:** 以下各项对应系统能力均为SystemCapability.MultimodalInput.Input.InputConsumer +此接口为系统接口。 + +**系统能力:**SystemCapability.MultimodalInput.Input.InputConsumer | 参数 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | 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 95beee6a1407ae88bc57445c7f6e0a6ca10a0fd6..d98b1ff295d3c290136a22d039bdcdfb10556977 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-inputdevice.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inputdevice.md @@ -179,7 +179,7 @@ inputDevice.getDevice(1).then((inputDevice)=>{ ## inputDevice.supportKeys9+ -supportKeys(deviceId: number, keys: Array<KeyCode>, callback: Callback<Array<boolean>>): void; +supportKeys(deviceId: number, keys: Array<KeyCode>, callback: Callback<Array<boolean>>): void 获取输入设备支持的键码值,使用callback方式作为异步方法。 @@ -204,7 +204,7 @@ inputDevice.supportKeys(1, [17, 22, 2055], (ret)=>{ ## inputDevice.supportKeys9+ -supportKeys(deviceId: number, keys: Array<KeyCode>): Promise<Array<boolean>>; +supportKeys(deviceId: number, keys: Array<KeyCode>): Promise<Array<boolean>> 获取输入设备支持的键码值,使用Promise方式作为异步方法。 @@ -234,7 +234,7 @@ inputDevice.supportKeys(1, [17, 22, 2055]).then((ret)=>{ ## inputDevice.getKeyboardType9+ -getKeyboardType(deviceId: number, callback: AsyncCallback<KeyboardType>): void; +getKeyboardType(deviceId: number, callback: AsyncCallback<KeyboardType>): void 查询输入设备的键盘类型,使用callback方式作为异步方法。 @@ -258,7 +258,7 @@ inputDevice.getKeyboardType(1, (ret)=>{ ## inputDevice.getKeyboardType9+ -getKeyboardType(deviceId: number,): Promise<KeyboardType>; +getKeyboardType(deviceId: number): Promise<KeyboardType> 查询输入设备的键盘类型,使用Promise方式作为异步方法。 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 a039363b77d61bbc19e84df958d638e61d8b21b3..01aaa9b2ba3954da6e5836be22729fb6d8a066f2 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-inputevent.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inputevent.md @@ -1,6 +1,6 @@ # 输入事件 -设备上报的基本事件。 +InputEvent模块描述了设备上报的基本事件。 > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 @@ -11,6 +11,8 @@ import InputEvent from '@ohos.multimodalInput.inputEvent'; ``` +## InputEvent + **系统能力**:以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.Core | 名称 | 参数类型 | 可读 | 可写 | 描述 | 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 9b5ea5c1c5f77b6eecb9035331355170b3980826..d199635658c38b565315bc9b0e760b8e67ba0cee 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-inputeventclient.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inputeventclient.md @@ -1,11 +1,12 @@ # 注入按键 +InputEventClient模块提供了注入按键能力。 > **说明:** > -> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 +> - 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > -> 本模块接口均为系统接口,三方应用不支持调用。 +> - 本模块接口均为系统接口,三方应用不支持调用。 ## 导入模块 @@ -22,6 +23,8 @@ injectEvent({KeyEvent: KeyEvent}): void 注入按键,KeyEvent为注入按键的描述信息。 +此接口为系统接口。 + **系统能力:** SystemCapability.MultimodalInput.Input.InputSimulator **参数:** @@ -47,11 +50,13 @@ let res = inputEventClient.injectEvent({KeyEvent: keyEvent}); 注入按键的描述信息 +此接口为系统接口。 + **系统能力:** 以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.InputSimulator | 参数 | 类型 | 必填 | 说明 | | --------------- | ------- | ---- | --------- | | isPressed | boolean | 是 | 按键是否按下 | -| keyCode | Number | 是 | 按键键值 | -| keyDownDuration | boolean | 是 | 按键按下持续时间 | -| isIntercepted | Number | 是 | 按键是否可以被拦截 | +| keyCode | number | 是 | 按键键值 | +| 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 cceb1567108cbf0887714c6bd489b4d7b27e4712..be52e915593fe57342e8e74ca2d5ac4a2a73f0de 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-inputmonitor.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inputmonitor.md @@ -1,5 +1,6 @@ # 输入监听 +InputMonitor模块提供了监听全局触摸事件的功能。 > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > - 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 @@ -26,6 +27,8 @@ on(type: "touch", receiver: TouchEventReceiver): void 开始监听全局触屏事件。 +此接口为系统接口。 + **需要权限:**ohos.permission.INPUT_MONITORING **系统能力:**SystemCapability.MultimodalInput.Input.InputMonitor @@ -45,20 +48,23 @@ inputMonitor.off("touch", (event) => { }); ``` -on(type: "mouse", receiver:Callback):void + +on(type: "mouse", receiver: Callback<MouseEvent>): void 开始监听全局鼠标事件。 +此接口为系统接口。 + **需要权限:** ohos.permission.INPUT_MONITORING **系统能力:** SystemCapability.MultimodalInput.Input.InputMonitor **参数:** -| 参数 | 类型 | 必填 | 说明 | -| -------- | -------------------- | ---- | ------------------------------- | -| type | string | 是 | 监听输入事件类型,取值“mouse”。 | -| receiver | Callback | 是 | 鼠标输入事件回调函数。 | +| 参数 | 类型 | 必填 | 说明 | +| -------- | -------------------------- | ---- | ------------------------------- | +| type | string | 是 | 监听输入事件类型,取值“mouse”。 | +| receiver | Callback<MouseEvent> | 是 | 鼠标输入事件回调函数。 | **示例:** @@ -72,10 +78,12 @@ inputMonitor.off("mouse", (event) => { ## inputMonitor.off -off(type: "touch", receiver?:TouchEventReceiver):void +off(type: "touch", receiver?: TouchEventReceiver): void 停止监听全局触屏事件。 +此接口为系统接口。 + **需要权限:**ohos.permission.INPUT_MONITORING **系统能力:**SystemCapability.MultimodalInput.Input.InputMonitor @@ -92,20 +100,22 @@ off(type: "touch", receiver?:TouchEventReceiver):void inputMonitor.off("touch"); ``` -off(type: "mouse", receiver?:Callback):void +off(type: "mouse", receiver?: Callback<MouseEvent>): void 停止监听全局鼠标事件。 +此接口为系统接口。 + **需要权限:**ohos.permission.INPUT_MONITORING **系统能力:**SystemCapability.MultimodalInput.Input.InputMonitor **参数:** -| 参数 | 类型 | 必填 | 说明 | -| -------- | -------------------- | ---- | ------------------------------- | -| type | string | 是 | 监听输入事件类型,取值“mouse”。 | -| receiver | Callback | 否 | 鼠标输入事件回调函数。 | +| 参数 | 类型 | 必填 | 说明 | +| -------- | -------------------------- | ---- | ------------------------------- | +| type | string | 是 | 监听输入事件类型,取值“mouse”。 | +| receiver | Callback<MouseEvent> | 否 | 鼠标输入事件回调函数。 | **示例:** @@ -119,10 +129,7 @@ inputMonitor.off("mouse"); 触摸输入事件的回调函数。如果返回true,则触摸输入被监听器消耗,系统将执行关闭动作。 - -### (touchEvent: TouchEvent): Boolean - -触摸输入事件的回调函数。函数名由使用者定义,这里是函数调用时必须符合的格式,传入参数必须为TouchEvent类型,返回值为Boolean类型。 +此接口为系统接口。 **系统能力:**SystemCapability.MultimodalInput.Input.InputMonitor 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 b7022e48fb9e6476200bf1ea23bba27da3ece196..2559bcf9dc665a91d8f79a60006e9a04cc1fcf10 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-keycode.md +++ b/zh-cn/application-dev/reference/apis/js-apis-keycode.md @@ -1,6 +1,6 @@ # 键值 -按键类设备键值。 +KeyCode模块提供了按键类设备的键值。 > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 @@ -11,6 +11,8 @@ import {KeyCode} from '@ohos.multimodalInput.keyCode' ``` +## KeyCode + **系统能力**:以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.Core | 名称 | 参数类型 | 可读 | 可写 | 描述 | 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 4252faf2be25d8dc1ea4a67889eb4194316dc0cb..a2d63e44c662562c36e169786426ab8f0cecce2e 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-keyevent.md +++ b/zh-cn/application-dev/reference/apis/js-apis-keyevent.md @@ -1,6 +1,6 @@ # 按键输入事件 -设备上报的按键事件。 +KeyEvent模块提供了设备可以上报的按键事件。 > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。