Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Coping0606
Docs
提交
46d6c710
D
Docs
项目概览
Coping0606
/
Docs
与 Fork 源项目一致
Fork自
OpenHarmony / Docs
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
46d6c710
编写于
6月 29, 2022
作者:
O
openharmony_ci
提交者:
Gitee
6月 29, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6014 multimodalinput amend
Merge pull request !6014 from 胡枭/master
上级
ced04eba
dc279b64
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
60 addition
and
39 deletion
+60
-39
zh-cn/application-dev/reference/apis/js-apis-inputconsumer.md
...n/application-dev/reference/apis/js-apis-inputconsumer.md
+17
-12
zh-cn/application-dev/reference/apis/js-apis-inputdevice.md
zh-cn/application-dev/reference/apis/js-apis-inputdevice.md
+4
-4
zh-cn/application-dev/reference/apis/js-apis-inputevent.md
zh-cn/application-dev/reference/apis/js-apis-inputevent.md
+3
-1
zh-cn/application-dev/reference/apis/js-apis-inputeventclient.md
...pplication-dev/reference/apis/js-apis-inputeventclient.md
+10
-5
zh-cn/application-dev/reference/apis/js-apis-inputmonitor.md
zh-cn/application-dev/reference/apis/js-apis-inputmonitor.md
+22
-15
zh-cn/application-dev/reference/apis/js-apis-keycode.md
zh-cn/application-dev/reference/apis/js-apis-keycode.md
+3
-1
zh-cn/application-dev/reference/apis/js-apis-keyevent.md
zh-cn/application-dev/reference/apis/js-apis-keyevent.md
+1
-1
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-inputconsumer.md
浏览文件 @
46d6c710
# 组合按键
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
<KeyOptions>
): 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
<KeyOptions>
): void
off(type: "key", keyOptions: KeyOptions, callback?: Callback
<
KeyOptions
>
): void
停止监听组合按键事件。
此接口为系统接口。
**系统能力:**
SystemCapability.MultimodalInput.Input.InputConsumer
**参数:**
| 参数 | 类型 | 必填 | 说明 |
| 参数 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| type | string | 是 | 监听输入事件类型,只支持“key”。 |
| keyOptions |
[
keyOptions
](
#keyOptions
)
| 是 | 开始监听时传入的keyOptions。 |
| callback | Callback
<KeyOptions>
| 是 | 开始监听时与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
| 参数 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
...
...
zh-cn/application-dev/reference/apis/js-apis-inputdevice.md
浏览文件 @
46d6c710
...
...
@@ -179,7 +179,7 @@ inputDevice.getDevice(1).then((inputDevice)=>{
## inputDevice.supportKeys<sup>9+</sup>
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.supportKeys<sup>9+</sup>
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.getKeyboardType<sup>9+</sup>
getKeyboardType(deviceId: number, callback: AsyncCallback
<
KeyboardType
>
): void
;
getKeyboardType(deviceId: number, callback: AsyncCallback
<
KeyboardType
>
): void
查询输入设备的键盘类型,使用callback方式作为异步方法。
...
...
@@ -258,7 +258,7 @@ inputDevice.getKeyboardType(1, (ret)=>{
## inputDevice.getKeyboardType<sup>9+</sup>
getKeyboardType(deviceId: number
,): Promise
<
KeyboardType
>
;
getKeyboardType(deviceId: number
): Promise
<
KeyboardType
>
查询输入设备的键盘类型,使用Promise方式作为异步方法。
...
...
zh-cn/application-dev/reference/apis/js-apis-inputevent.md
浏览文件 @
46d6c710
# 输入事件
设备上报的基本事件。
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
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
...
...
zh-cn/application-dev/reference/apis/js-apis-inputeventclient.md
浏览文件 @
46d6c710
# 注入按键
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 |
N
umber | 是 | 按键键值 |
| keyDownDuration |
boolean
| 是 | 按键按下持续时间 |
| isIntercepted |
Number
| 是 | 按键是否可以被拦截 |
| keyCode |
n
umber | 是 | 按键键值 |
| keyDownDuration |
number
| 是 | 按键按下持续时间 |
| isIntercepted |
boolean
| 是 | 按键是否可以被拦截 |
zh-cn/application-dev/reference/apis/js-apis-inputmonitor.md
浏览文件 @
46d6c710
# 输入监听
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
<MouseEvent>
):void
on(type: "mouse", receiver: Callback
<
MouseEvent
>
): void
开始监听全局鼠标事件。
此接口为系统接口。
**需要权限:**
ohos.permission.INPUT_MONITORING
**系统能力:**
SystemCapability.MultimodalInput.Input.InputMonitor
**参数:**
| 参数 | 类型 | 必填 | 说明 |
| -------- | -------------------- | ---- | ------------------------------- |
| type | string | 是 | 监听输入事件类型,取值“mouse”。 |
| receiver | Callback
<MouseEvent>
| 是 | 鼠标输入事件回调函数。 |
| 参数 | 类型
| 必填 | 说明 |
| -------- | --------------------
------
| ---- | ------------------------------- |
| 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
<MouseEvent>
):
void
off(type: "mouse", receiver?:
Callback
<
MouseEvent
>
):
void
停止监听全局鼠标事件。
此接口为系统接口。
**需要权限:**
ohos.permission.INPUT_MONITORING
**系统能力:**
SystemCapability.MultimodalInput.Input.InputMonitor
**参数:**
| 参数 | 类型 | 必填 | 说明 |
| -------- | -------------------- | ---- | ------------------------------- |
| type | string | 是 | 监听输入事件类型,取值“mouse”。 |
| receiver | Callback
<MouseEvent>
| 否 | 鼠标输入事件回调函数。 |
| 参数 | 类型
| 必填 | 说明 |
| -------- | --------------------
------
| ---- | ------------------------------- |
| type | string
| 是 | 监听输入事件类型,取值“mouse”。 |
| receiver | Callback
<
MouseEvent
>
| 否 | 鼠标输入事件回调函数。 |
**示例:**
...
...
@@ -119,10 +129,7 @@ inputMonitor.off("mouse");
触摸输入事件的回调函数。如果返回true,则触摸输入被监听器消耗,系统将执行关闭动作。
### (touchEvent: TouchEvent): Boolean
触摸输入事件的回调函数。函数名由使用者定义,这里是函数调用时必须符合的格式,传入参数必须为TouchEvent类型,返回值为Boolean类型。
此接口为系统接口。
**系统能力:**
SystemCapability.MultimodalInput.Input.InputMonitor
...
...
zh-cn/application-dev/reference/apis/js-apis-keycode.md
浏览文件 @
46d6c710
# 键值
按键类设备
键值。
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
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
...
...
zh-cn/application-dev/reference/apis/js-apis-keyevent.md
浏览文件 @
46d6c710
# 按键输入事件
设备
上报的按键事件。
KeyEvent模块提供了设备可以
上报的按键事件。
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录