Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
d37d67ba
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
d37d67ba
编写于
7月 25, 2023
作者:
O
openharmony_ci
提交者:
Gitee
7月 25, 2023
浏览文件
操作
浏览文件
下载
差异文件
!21310 输入法框架,接口变更changelog中少了一个off('handleExtendAction')的接口
Merge pull request !21310 from guojin31/master
上级
0336a600
6e8435a5
变更
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
浏览文件 @
d37d67ba
...
@@ -1821,7 +1821,7 @@ inputMethodController.off('deleteRight');
...
@@ -1821,7 +1821,7 @@ inputMethodController.off('deleteRight');
### on('sendKeyboardStatus')<sup>10+</sup>
### 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异步回调。
订阅输入法应用发送键盘状态事件。使用callback异步回调。
...
@@ -1832,7 +1832,7 @@ on(type: 'sendKeyboardStatus', callback: (keyBoardStatus: KeyboardStatus) => voi
...
@@ -1832,7 +1832,7 @@ on(type: 'sendKeyboardStatus', callback: (keyBoardStatus: KeyboardStatus) => voi
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------ | ---- | ---- |
| -------- | ------ | ---- | ---- |
| type | string | 是 | 设置监听类型。
<br/>
- type为‘sendKeyboardStatus’时表示订阅输入法应用发送键盘状态事件监听。 |
| 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
...
@@ -1846,8 +1846,8 @@ on(type: 'sendKeyboardStatus', callback: (keyBoardStatus: KeyboardStatus) => voi
```
js
```
js
try
{
try
{
inputMethodController
.
on
(
'
sendKeyboardStatus
'
,
(
key
B
oardStatus
)
=>
{
inputMethodController
.
on
(
'
sendKeyboardStatus
'
,
(
key
b
oardStatus
)
=>
{
console
.
log
(
`Succeeded in subscribing sendKeyboardStatus, key
BoardStatus:
${
keyB
oardStatus
}
`
);
console
.
log
(
`Succeeded in subscribing sendKeyboardStatus, key
boardStatus:
${
keyb
oardStatus
}
`
);
});
});
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
error
(
`Failed to subscribe sendKeyboardStatus:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to subscribe sendKeyboardStatus:
${
JSON
.
stringify
(
err
)}
`
);
...
@@ -1856,7 +1856,7 @@ try {
...
@@ -1856,7 +1856,7 @@ try {
### off('sendKeyboardStatus')<sup>10+</sup>
### 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
...
@@ -1867,13 +1867,13 @@ off(type: 'sendKeyboardStatus', callback?: (keyBoardStatus: KeyboardStatus) => v
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | 是 | 设置监听类型。
<br/>
- type为‘sendKeyboardStatus’时表示取消订阅输入法应用发送键盘状态事件监听。 |
| type | string | 是 | 设置监听类型。
<br/>
- type为‘sendKeyboardStatus’时表示取消订阅输入法应用发送键盘状态事件监听。 |
| callback | (key
B
oardStatus:
[
KeyboardStatus
](
#keyboardstatus10
)
) => void | 否 | 取消订阅的回调函数,需要与on接口传入的保持一致。当该参数不填写时,取消订阅type对应的所有回调事件。 |
| callback | (key
b
oardStatus:
[
KeyboardStatus
](
#keyboardstatus10
)
) => void | 否 | 取消订阅的回调函数,需要与on接口传入的保持一致。当该参数不填写时,取消订阅type对应的所有回调事件。 |
**示例:**
**示例:**
```
js
```
js
let
onSendKeyboardStatus
=
(
key
B
oardStatus
:
KeyboardStatus
)
=>
{
let
onSendKeyboardStatus
=
(
key
b
oardStatus
:
KeyboardStatus
)
=>
{
console
.
log
(
`Succeeded in subscribing sendKeyboardStatus, key
BoardStatus:
${
keyB
oardStatus
}
`
);
console
.
log
(
`Succeeded in subscribing sendKeyboardStatus, key
boardStatus:
${
keyb
oardStatus
}
`
);
};
};
inputMethodController
.
off
(
'
sendKeyboardStatus
'
,
onSendKeyboardStatus
);
inputMethodController
.
off
(
'
sendKeyboardStatus
'
,
onSendKeyboardStatus
);
inputMethodController
.
off
(
'
sendKeyboardStatus
'
);
inputMethodController
.
off
(
'
sendKeyboardStatus
'
);
...
@@ -2935,4 +2935,4 @@ inputMethodSetting.displayOptionalInputMethod().then(() => {
...
@@ -2935,4 +2935,4 @@ inputMethodSetting.displayOptionalInputMethod().then(() => {
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
`Failed to displayOptionalInputMethod:
${
JSON
.
stringify
(
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
浏览文件 @
d37d67ba
...
@@ -21,9 +21,10 @@ off接口新增需要取消订阅的回调函数作为可选参数,需要与on
...
@@ -21,9 +21,10 @@ off接口新增需要取消订阅的回调函数作为可选参数,需要与on
| off('insertText') | off(type: 'insertText'): void | off(type: 'insertText', callback?: (text: string) => void): void |
| 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('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('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('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('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('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 |
| 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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录