未验证 提交 af32ae67 编写于 作者: O openharmony_ci 提交者: Gitee

!17826 输入法框架资料需求:自绘控件

Merge pull request !17826 from Hollokin/master
# InputMethodCommon
> **说明:**
> 本模块首批接口从API version 10 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
输入法框架接口定义的公共属性信息。
## Direction
光标移动方向类型枚举。
**系统能力:** SystemCapability.MiscServices.InputMethodFramework
| 名称 | 值 | 说明 |
| ------------ | ---- | ---------- |
| CURSOR_UP | 1 | 光标上移。 |
| CURSOR_DOWN | 2 | 光标下移。 |
| CURSOR_LEFT | 3 | 光标左移。 |
| CURSOR_RIGHT | 4 | 光标右移。 |
## Range
描述选中文本的范围。
**系统能力:** SystemCapability.MiscServices.InputMethodFramework
| 名称 | 类型 | 可读 | 可写 | 说明 |
| ----- | ------ | ---- | ---- | ---------------------------------- |
| start | number | 是 | 是 | 选中文本的首字符在编辑框的索引值。 |
| end | number | 是 | 是 | 选中文本的末字符在编辑框的索引值。 |
## Movement
描述进行选中文本动作时光标移动的方向。
**系统能力:** SystemCapability.MiscServices.InputMethodFramework
| 名称 | 类型 | 可读 | 可写 | 说明 |
| --------- | ----------------------- | ---- | ---- | ---------------------------------- |
| direction | [Direction](#direction) | 是 | 是 | 进行选中文本动作时光标移动的方向。 |
......@@ -38,9 +38,9 @@ Extension生命周期回调,在拉起Extension输入法应用时调用,执
```js
class InputMethodExt extends InputMethodExtensionAbility {
onCreate(want) {
console.log('onCreate, want:' + want.abilityName);
}
onCreate(want) {
console.log('onCreate, want:' + want.abilityName);
}
}
```
......@@ -56,8 +56,8 @@ Extension生命周期回调,在销毁输入法应用时回调,执行资源
```js
class InputMethodExt extends InputMethodExtensionAbility {
onDestroy() {
console.log('onDestroy');
}
onDestroy() {
console.log('onDestroy');
}
}
```
......@@ -21,9 +21,9 @@ import InputMethodExtensionContext from '@ohos.InputMethodExtensionContext';
```js
import InputMethodExtensionAbility from '@ohos.InputMethodExtensionAbility';
class EntryAbility extends InputMethodExtensionAbility {
onCreate() {
let context = this.context;
}
onCreate() {
let context = this.context;
}
}
```
......@@ -44,8 +44,8 @@ destroy(callback: AsyncCallback\<void>): void
**示例:**
```js
this.context.destroy((err) => {
console.log('destroy result:' + JSON.stringify(err));
this.context.destroy(() => {
console.log('Succeeded in destroying context.');
});
```
......@@ -67,8 +67,6 @@ destroy(): Promise\<void>;
```js
this.context.destroy().then(() => {
console.log('Succeed in destoring context.');
}).catch((error) => {
console.log('Failed to destory context: ' + JSON.stringify(error));
console.log('Succeed in destroying context.');
});
```
......@@ -58,23 +58,23 @@ Input method client error.
重新将输入法应用与三方应用进行绑定:将三方应用后台进程杀死,重新启动三方应用,通过点击对话框等方式触发输入法键盘的显示,若键盘正常显示,则问题解决。
## 12800004 按键事件处理异常
## 12800004 不是输入法应用
**错误信息**
Key event processing error.
Not an input method extension.
**错误描述**
按键事件异常时,系统会报此错误码。
其他应用调用了仅支持输入法应用调用的接口时,系统会报此错误码。
**可能原因**
按键事件分发、消费、监听异常时会报错
在其他应用中调用了仅支持输入法应用调用的接口
**处理步骤**
在输入法应用中调用此接口。
## 12800005 配置固化失败
......@@ -146,4 +146,22 @@ Input method manager service error.
**处理步骤**
通过ps -A|grep inputmethod查看是否存在输入法服务的进程号,如果存在,则服务正常。
\ No newline at end of file
通过ps -A|grep inputmethod查看是否存在输入法服务的进程号,如果存在,则服务正常。
## 12800009 输入法客户端未绑定
**错误信息**
Input method client is detached.
**错误描述**
当前应用未绑定输入法应用。
**可能原因**
当前应用在没有绑定输入法的情况下执行了比如showTextInput、hideTextInput等操作。
**处理步骤**
先执行attach接口操作即可。
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册