diff --git a/api/@ohos.inputmethod.d.ts b/api/@ohos.inputmethod.d.ts index 21a0439b5f4d0758007ca00c5c643fa09f4d72ea..2ec69c2eeb4b37a92c26744b2e753eb227fa02a3 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 39b3b83bae1009fb04d71f19440ee9293b4711ef..0f11096d63625ec99043161ed79b591e983e3ef9 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;