Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
6e8435a5
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
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看板
提交
6e8435a5
编写于
7月 24, 2023
作者:
G
guojin31
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Bugfix: add changelog for interface
Signed-off-by:
N
guojin31
<
guojin31@huawei.com
>
上级
75c0a5c5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
10 deletion
+11
-10
zh-cn/application-dev/reference/apis/js-apis-inputmethod.md
zh-cn/application-dev/reference/apis/js-apis-inputmethod.md
+9
-9
zh-cn/release-notes/changelogs/OpenHarmony_4.0.9.2/changelogs-imf.md
...se-notes/changelogs/OpenHarmony_4.0.9.2/changelogs-imf.md
+2
-1
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-inputmethod.md
浏览文件 @
6e8435a5
...
...
@@ -1821,7 +1821,7 @@ inputMethodController.off('deleteRight');
### on('sendKeyboardStatus')<sup>10+</sup>
on(type: 'sendKeyboardStatus', callback: (key
B
oardStatus: KeyboardStatus) => void): void
on(type: 'sendKeyboardStatus', callback: (key
b
oardStatus: KeyboardStatus) => void): void
订阅输入法应用发送键盘状态事件。使用callback异步回调。
...
...
@@ -1832,7 +1832,7 @@ on(type: 'sendKeyboardStatus', callback: (keyBoardStatus: KeyboardStatus) => voi
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------ | ---- | ---- |
| type | string | 是 | 设置监听类型。
<br/>
- type为‘sendKeyboardStatus’时表示订阅输入法应用发送键盘状态事件监听。 |
| callback | (key
B
oardStatus:
[
KeyboardStatus
](
#keyboardstatus10
)
) => void | 是 | 回调函数,返回键盘状态。
<br/>
开发者需要在回调函数中根据传入的键盘状态做相应动作。 |
| callback | (key
b
oardStatus:
[
KeyboardStatus
](
#keyboardstatus10
)
) => void | 是 | 回调函数,返回键盘状态。
<br/>
开发者需要在回调函数中根据传入的键盘状态做相应动作。 |
**错误码:**
...
...
@@ -1846,8 +1846,8 @@ on(type: 'sendKeyboardStatus', callback: (keyBoardStatus: KeyboardStatus) => voi
```
js
try
{
inputMethodController
.
on
(
'
sendKeyboardStatus
'
,
(
key
B
oardStatus
)
=>
{
console
.
log
(
`Succeeded in subscribing sendKeyboardStatus, key
BoardStatus:
${
keyB
oardStatus
}
`
);
inputMethodController
.
on
(
'
sendKeyboardStatus
'
,
(
key
b
oardStatus
)
=>
{
console
.
log
(
`Succeeded in subscribing sendKeyboardStatus, key
boardStatus:
${
keyb
oardStatus
}
`
);
});
}
catch
(
err
)
{
console
.
error
(
`Failed to subscribe sendKeyboardStatus:
${
JSON
.
stringify
(
err
)}
`
);
...
...
@@ -1856,7 +1856,7 @@ try {
### off('sendKeyboardStatus')<sup>10+</sup>
off(type: 'sendKeyboardStatus', callback?: (key
B
oardStatus: KeyboardStatus) => void): void
off(type: 'sendKeyboardStatus', callback?: (key
b
oardStatus: KeyboardStatus) => void): void
取消订阅输入法应用发送键盘状态事件。
...
...
@@ -1867,13 +1867,13 @@ off(type: 'sendKeyboardStatus', callback?: (keyBoardStatus: KeyboardStatus) => v
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | 是 | 设置监听类型。
<br/>
- type为‘sendKeyboardStatus’时表示取消订阅输入法应用发送键盘状态事件监听。 |
| callback | (key
B
oardStatus:
[
KeyboardStatus
](
#keyboardstatus10
)
) => void | 否 | 取消订阅的回调函数,需要与on接口传入的保持一致。当该参数不填写时,取消订阅type对应的所有回调事件。 |
| callback | (key
b
oardStatus:
[
KeyboardStatus
](
#keyboardstatus10
)
) => void | 否 | 取消订阅的回调函数,需要与on接口传入的保持一致。当该参数不填写时,取消订阅type对应的所有回调事件。 |
**示例:**
```
js
let
onSendKeyboardStatus
=
(
key
B
oardStatus
:
KeyboardStatus
)
=>
{
console
.
log
(
`Succeeded in subscribing sendKeyboardStatus, key
BoardStatus:
${
keyB
oardStatus
}
`
);
let
onSendKeyboardStatus
=
(
key
b
oardStatus
:
KeyboardStatus
)
=>
{
console
.
log
(
`Succeeded in subscribing sendKeyboardStatus, key
boardStatus:
${
keyb
oardStatus
}
`
);
};
inputMethodController
.
off
(
'
sendKeyboardStatus
'
,
onSendKeyboardStatus
);
inputMethodController
.
off
(
'
sendKeyboardStatus
'
);
...
...
@@ -2935,4 +2935,4 @@ inputMethodSetting.displayOptionalInputMethod().then(() => {
}).
catch
((
err
)
=>
{
console
.
error
(
`Failed to displayOptionalInputMethod:
${
JSON
.
stringify
(
err
)}
`
);
})
```
```
\ No newline at end of file
zh-cn/release-notes/changelogs/OpenHarmony_4.0.9.2/changelogs-imf.md
浏览文件 @
6e8435a5
...
...
@@ -21,9 +21,10 @@ off接口新增需要取消订阅的回调函数作为可选参数,需要与on
| off('insertText') | off(type: 'insertText'): void | off(type: 'insertText', callback?: (text: string) => void): void |
| off('deleteLeft') | off(type: 'deleteLeft'): void | off(type: 'deleteLeft', callback?: (length: number) => void): void |
| off('deleteRight') | off(type: 'deleteRight'): void | off(type: 'deleteRight', callback?: (length: number) => void): void |
| off('sendKeyboardStatus') | off(type: 'sendKeyboardStatus'): void | off(type: 'sendKeyboardStatus', callback?: (key
B
oardStatus: KeyboardStatus) => void): void |
| off('sendKeyboardStatus') | off(type: 'sendKeyboardStatus'): void | off(type: 'sendKeyboardStatus', callback?: (key
b
oardStatus: KeyboardStatus) => void): void |
| off('sendFunctionKey') | off(type: 'sendFunctionKey'): void | off(type: 'sendFunctionKey', callback?: (functionKey: FunctionKey) => void): void |
| off('moveCursor') | off(type: 'moveCursor'): void | off(type: 'moveCursor', callback?: (direction: Direction) => void): void |
| off('handleExtendAction') | off(type: 'handleExtendAction'): void | off(type: 'handleExtendAction', callback?: (action: ExtendAction) => void): void |
| off('selectByRange') | off(type: 'selectByRange'): void | off(type: 'selectByRange', callback?: Callback
\<
Range
\>
): void |
| off('selectByMovement') | off(type: 'selectByMovement'): void | off(type: 'selectByMovement', callback?: Callback
\<
Movement
\>
): void |
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录