Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
60a06c7b
D
Docs
项目概览
OpenHarmony
/
Docs
大约 2 年 前同步成功
通知
161
Star
293
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看板
提交
60a06c7b
编写于
7月 30, 2022
作者:
M
ma-shaoyin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Signed-off-by: ma-shaoyin <mashaoyin1@huawei.com>
Changes to be committed:
上级
13bef3d4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
11 deletion
+11
-11
zh-cn/application-dev/reference/apis/js-apis-inputmethod.md
zh-cn/application-dev/reference/apis/js-apis-inputmethod.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-inputmethodengine.md
...plication-dev/reference/apis/js-apis-inputmethodengine.md
+10
-10
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-inputmethod.md
浏览文件 @
60a06c7b
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
## 导入模块
## 导入模块
```
```
import inputMethod from '@ohos.input
M
ethod';
import inputMethod from '@ohos.input
m
ethod';
```
```
## inputMethod<sup>8+</sup>
## inputMethod<sup>8+</sup>
...
...
zh-cn/application-dev/reference/apis/js-apis-inputmethodengine.md
浏览文件 @
60a06c7b
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
## 导入模块
## 导入模块
```
```
import inputMethodEngine from '@ohos.input
MethodE
ngine';
import inputMethodEngine from '@ohos.input
methode
ngine';
```
```
## inputMethodEngine
## inputMethodEngine
...
@@ -180,7 +180,7 @@ off(type: 'keyboardShow'|'keyboardHide', callback?: () => void): void
...
@@ -180,7 +180,7 @@ off(type: 'keyboardShow'|'keyboardHide', callback?: () => void): void
```
js
```
js
InputMethodEngine
.
off
(
'
keyboardShow
'
);
InputMethodEngine
.
off
(
'
keyboardShow
'
);
```
```
## KeyboardDelegate<a name="KeyboardDelegate"></a>
## KeyboardDelegate<a name="KeyboardDelegate"></a>
...
@@ -250,7 +250,7 @@ on(type: 'cursorContextChange', callback: (x: number, y:number, height:number) =
...
@@ -250,7 +250,7 @@ on(type: 'cursorContextChange', callback: (x: number, y:number, height:number) =
**示例:**
**示例:**
```js
```js
KeyboardDelegate.on('cursorContextChange', (x, y, height) => {
KeyboardDelegate.on('cursorContextChange', (x, y, height) => {
console.info('cursorContextChange');
console.info('cursorContextChange');
...
@@ -294,7 +294,7 @@ on(type: 'selectionChange', callback: (oldBegin: number, oldEnd: number, newBegi
...
@@ -294,7 +294,7 @@ on(type: 'selectionChange', callback: (oldBegin: number, oldEnd: number, newBegi
| callback | number | 是 | 回调返回文本选择信息。 |
| callback | number | 是 | 回调返回文本选择信息。 |
**示例:**
**示例:**
```js
```js
KeyboardDelegate.on('selectionChange', (oldBegin, oldEnd, newBegin, newEnd) => {
KeyboardDelegate.on('selectionChange', (oldBegin, oldEnd, newBegin, newEnd) => {
console.info('selectionChange');
console.info('selectionChange');
...
@@ -548,11 +548,11 @@ deleteForward(length:number): Promise<boolean>
...
@@ -548,11 +548,11 @@ deleteForward(length:number): Promise<boolean>
**系统能力**
: SystemCapability.MiscServices.InputMethodFramework
**系统能力**
: SystemCapability.MiscServices.InputMethodFramework
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| length | number | 是 | 文本长度。 |
| length | number | 是 | 文本长度。 |
**返回值:**
**返回值:**
| 类型 | 说明 |
| 类型 | 说明 |
...
@@ -565,7 +565,7 @@ deleteForward(length:number): Promise<boolean>
...
@@ -565,7 +565,7 @@ deleteForward(length:number): Promise<boolean>
var isSuccess = TextInputClient.deleteForward(5);
var isSuccess = TextInputClient.deleteForward(5);
console.info("isSuccess = " + isSuccess);
console.info("isSuccess = " + isSuccess);
```
```
### deleteBackward
### deleteBackward
deleteBackward(length:number, callback: AsyncCallback
<
boolean
>
): void
deleteBackward(length:number, callback: AsyncCallback
<
boolean
>
): void
...
@@ -663,7 +663,7 @@ sendKeyFunction(action:number): Promise<boolean>
...
@@ -663,7 +663,7 @@ sendKeyFunction(action:number): Promise<boolean>
var
isSuccess
=
TextInputClient
.
sendKeyFunction
(
inputMethod
.
ENTER_KEY_TYPE_NEXT
);
var
isSuccess
=
TextInputClient
.
sendKeyFunction
(
inputMethod
.
ENTER_KEY_TYPE_NEXT
);
console
.
info
(
"
isSuccess =
"
+
isSuccess
);
console
.
info
(
"
isSuccess =
"
+
isSuccess
);
```
```
### insertText
### insertText
insertText(text:string, callback: AsyncCallback
<
boolean
>
): void
insertText(text:string, callback: AsyncCallback
<
boolean
>
): void
...
@@ -702,7 +702,7 @@ insertText(text:string): Promise<boolean>
...
@@ -702,7 +702,7 @@ insertText(text:string): Promise<boolean>
| text | string | 是 | 文本。 |
| text | string | 是 | 文本。 |
**返回值:**
**返回值:**
| 类型 | 说明 |
| 类型 | 说明 |
| ------------------------------- | ------------------------------------------------------------ |
| ------------------------------- | ------------------------------------------------------------ |
| Promise
<
boolean
>
| 操作成功与否。 |
| Promise
<
boolean
>
| 操作成功与否。 |
...
@@ -713,7 +713,7 @@ insertText(text:string): Promise<boolean>
...
@@ -713,7 +713,7 @@ insertText(text:string): Promise<boolean>
var
isSuccess
=
TextInputClient
.
insertText
(
"
test
"
);
var
isSuccess
=
TextInputClient
.
insertText
(
"
test
"
);
console
.
info
(
"
isSuccess =
"
+
isSuccess
);
console
.
info
(
"
isSuccess =
"
+
isSuccess
);
```
```
### getEditorAttribute
### getEditorAttribute
getEditorAttribute(callback: AsyncCallback
<
EditorAttribute
>
): void
getEditorAttribute(callback: AsyncCallback
<
EditorAttribute
>
): void
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录