From be07ce1717371a7cae05ef2ffd061f537cbb555b Mon Sep 17 00:00:00 2001 From: zhouyongfei Date: Thu, 17 Mar 2022 16:36:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=B5=84=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhouyongfei --- api/@ohos.inputmethod.d.ts | 4 ++-- api/@ohos.inputmethodengine.d.ts | 23 ++++++++++------------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/api/@ohos.inputmethod.d.ts b/api/@ohos.inputmethod.d.ts index 21a0439b5f..2ec69c2eeb 100644 --- a/api/@ohos.inputmethod.d.ts +++ b/api/@ohos.inputmethod.d.ts @@ -18,8 +18,8 @@ import {AsyncCallback} from './basic'; /** * inputmethod * - * @since 8 - * @syscap SystemCapability.MiscServices.InputMethod + * @since 6 + * @syscap SystemCapability.MiscServices.InputMethodFramework */ declare namespace inputMethod { const MAX_TYPE_NUM: number diff --git a/api/@ohos.inputmethodengine.d.ts b/api/@ohos.inputmethodengine.d.ts index 39b3b83bae..0f11096d63 100644 --- a/api/@ohos.inputmethodengine.d.ts +++ b/api/@ohos.inputmethodengine.d.ts @@ -19,7 +19,7 @@ import {AsyncCallback} from './basic'; * inputmethodengine * * @since 8 - * @syscap SystemCapability.MiscServices.InputMethodEngine + * @syscap SystemCapability.MiscServices.InputMethodFramework */ declare namespace inputMethodEngine { const ENTER_KEY_TYPE_UNSPECIFIED: number; @@ -68,13 +68,9 @@ declare namespace inputMethodEngine { off(type: 'inputStart', callback?: (kbController: KeyboardController, textInputClient: TextInputClient) => void): void; - on(type: 'keyboardShow', callback: () => void): void; + on(type: 'keyboardShow|keyboardHide', callback: () => void): void; - off(type: 'keyboardShow', callback: () => void): void; - - on(type: 'keyboardHide', callback: () => void): void; - - off(type: 'keyboardHide', callback: () => void): void; + off(type: 'keyboardShow|keyboardHide', callback?: () => void): void; } interface TextInputClient { @@ -104,13 +100,9 @@ declare namespace inputMethodEngine { } interface KeyboardDelegate { - on(type: 'keyDown', callback: (event: KeyEvent) => boolean): void; - - off(type: 'keyDown', callback?: (event: KeyEvent) => boolean): void; + on(type: 'keyDown|keyUp', callback: (event: KeyEvent) => boolean): void; - on(type: 'keyUp', callback: (event: KeyEvent) => boolean): void; - - off(type: 'keyUp', callback?: (event: KeyEvent) => boolean): void; + off(type: 'keyDown|keyUp', callback?: (event: KeyEvent) => boolean): void; on(type: 'cursorContextChange', callback: (x: number, y: number, height: number) => void): void; @@ -129,6 +121,11 @@ declare namespace inputMethodEngine { readonly inputPattern: number; readonly enterKeyType: number; } + + interface KeyEvent { + readonly keyCode: number; + readonly keyAction: number; + } } export default inputMethodEngine; -- Gitee